1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Revert "Removing Leonardo (and Mouse/Keyboard examples) for Arduino 1.0 release."

This reverts commit dca1dc429a.
This commit is contained in:
David A. Mellis
2011-12-16 15:58:42 -05:00
parent 64c8b89b5f
commit f0923daa4f
3 changed files with 191 additions and 0 deletions

View File

@ -0,0 +1,33 @@
/*
Keyboard test
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
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);
}
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);
}
}