1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-12 20:49:16 +03:00
Files
.settings
app
build
cmd
javadoc
linux
macosx
shared
examples
01.Basics
02.Digital
03.Analog
04.Communication
05.Control
06.Sensors
07.Display
08.Strings
09.USB
Keyboard
KeyboardLogout
KeyboardMessage
KeyboardReprogram
KeyboardSerial
KeyboardSerial.ino
KeyboardAndMouseControl
Mouse
10.StarterKit
ArduinoISP
icons
lib
tools
manpage.adoc
reference.zip
revisions.txt
windows
build.xml
create_reference.pl
fetch.sh
howto.txt
core
hardware
libraries
.classpath
.gitignore
.project
format.every.sketch.sh
license.txt
readme.txt
todo.txt
esp8266/build/shared/examples/09.USB/Keyboard/KeyboardSerial/KeyboardSerial.ino
2013-10-21 09:58:40 +02:00

39 lines
797 B
C++

/*
Keyboard test
For the Arduino Leonardo, Micro or Due
Reads a byte from the serial port, sends a keystroke back.
The sent keystroke is one higher than what's received, e.g.
if you send a, you get b, send A you get B, and so forth.
The circuit:
* none
created 21 Oct 2011
modified 27 Mar 2012
by Tom Igoe
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/KeyboardSerial
*/
void setup() {
// open the serial port:
Serial.begin(9600);
// initialize control over the keyboard:
Keyboard.begin();
}
void loop() {
// check for incoming serial data:
if (Serial.available() > 0) {
// read incoming serial data:
char inChar = Serial.read();
// Type the next ASCII value from what you received:
Keyboard.write(inChar + 1);
}
}