Created
May 29, 2012 10:38
-
-
Save johnschimmel/2825072 to your computer and use it in GitHub Desktop.
Teensyduino Keyboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Simple USB Keyboard Example | |
Teensy becomes a USB keyboard and types characters | |
REQUIREMENTS - Install the Teensyduino (arduino ide plugins) | |
http://www.pjrc.com/teensy/td_download.html | |
Before programming you must select Keyboard from the "Tools > USB Type" menu | |
This example code is in the public domain. | |
*/ | |
int count = 0; | |
void setup() { | |
Serial.begin(9600); | |
delay(5000); | |
pinMode(2, INPUT); | |
} | |
void loop() { | |
// if you are touching yellow GRND wire and Celery the digital pin will go LOW | |
if (digitalRead(2) == LOW) { | |
Keyboard.print("A"); | |
} | |
// typing too rapidly can overwhelm a PC | |
delay(100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment