Created
July 5, 2014 06:41
-
-
Save mackee/47888dc17aeb2db6b32e 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
void setup() { | |
pinMode(13, OUTPUT); | |
Serial.begin(9600); | |
} | |
char data; | |
int f = 0; | |
void loop() { | |
if (Serial.available() > 0) { | |
data = Serial.read(); | |
if (f) { | |
digitalWrite(13, HIGH); | |
f = 0; | |
} | |
else { | |
digitalWrite(13, LOW); | |
f = 1; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment