// 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 Mouse.begin(); // start mouse } 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) { Mouse.press(MOUSE_LEFT); } else { Mouse.release(MOUSE_LEFT); } delay(5); // wait 5 ms }