-
-
Save mschmitt/f9c5791a394b47e93183 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Arduino Leonardo: Send key when a button is pressed. | |
void setup() { | |
pinMode(12, INPUT_PULLUP); | |
Keyboard.begin(); | |
} | |
void loop() { | |
//if the button is pressed | |
if(digitalRead(12)==LOW){ | |
Keyboard.press(KEY_LEFT_ALT); | |
Keyboard.press(KEY_F12); | |
delay(100); | |
Keyboard.releaseAll(); | |
delay(200); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment