Created
October 31, 2013 19:43
-
-
Save ah01/7255625 to your computer and use it in GitHub Desktop.
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
#include <Bounce.h> | |
#define PEDAL_PIN 2 | |
Bounce pedal = Bounce(PEDAL_PIN, 50); | |
void setup() | |
{ | |
pinMode(PEDAL_PIN, INPUT_PULLUP); | |
Keyboard.begin(); | |
} | |
void loop() | |
{ | |
pedal.update(); | |
if (pedal.fallingEdge()) | |
{ | |
Keyboard.press(KEY_ESC); | |
delay(100); | |
Keyboard.releaseAll(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment