Skip to content

Instantly share code, notes, and snippets.

@ah01
Created October 31, 2013 19:43
Show Gist options
  • Save ah01/7255625 to your computer and use it in GitHub Desktop.
Save ah01/7255625 to your computer and use it in GitHub Desktop.
#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