Skip to content

Instantly share code, notes, and snippets.

@johnschimmel
Created May 29, 2012 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save johnschimmel/2825072 to your computer and use it in GitHub Desktop.
Save johnschimmel/2825072 to your computer and use it in GitHub Desktop.
Teensyduino Keyboard
/* 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