Skip to content

Instantly share code, notes, and snippets.

@mackee
Created July 5, 2014 06:41
Show Gist options
  • Save mackee/47888dc17aeb2db6b32e to your computer and use it in GitHub Desktop.
Save mackee/47888dc17aeb2db6b32e to your computer and use it in GitHub Desktop.
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