// Josef Spjut // August 2015 void setup() { // put your setup code here, to run once: pinMode(4, INPUT_PULLUP); // set pullup resistor for button pinMode(13, OUTPUT); // set LED out Keyboard.begin(); // start keyboard } void loop() { // put your main code here, to run repeatedly: int val = digitalRead(4); // Read button digitalWrite(13, val); // Turn LED to match button // Press 'a' if pressed, otherwise release 'a' if (val == LOW) { Keyboard.press('a'); } else { Keyboard.release('a'); } delay(5); // wait 5 ms }