Skip to content

Instantly share code, notes, and snippets.

@lvidarte lvidarte/sketch.ino
Created Dec 13, 2014

Embed
What would you like to do?
char c;
int led = 4;
int counter = 0;
void setup()
{
Serial.begin(57600);
pinMode(led, OUTPUT);
}
void loop()
{
while (Serial.available() > 0) {
c = Serial.read();
Serial.print(c);
if (c == 't') {
digitalWrite(led, (counter++ % 2 == 0) ? HIGH : LOW);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.