Last active
January 5, 2016 16:45
-
-
Save mrrcollins/d7ecb12d2563e7a13ba8 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 <Keyboard.h> | |
int sensorPin = 10; | |
void setup() | |
{ | |
pinMode(sensorPin, INPUT); | |
Serial.begin(9600); | |
Keyboard.begin(); | |
} | |
void sendWakeUp(void); | |
void loop() | |
{ | |
if (digitalRead(sensorPin) == 1) | |
{ | |
sendWakeUp(); | |
while (digitalRead(sensorPin) == 1) | |
{ | |
delay(1); | |
} | |
} | |
delay(1000); | |
} | |
void sendWakeUp(void) | |
{ | |
Keyboard.press('a'); | |
delay(1); | |
Keyboard.release('a'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment