Skip to content

Instantly share code, notes, and snippets.

@taesamja
Created December 27, 2016 03:42
Show Gist options
  • Save taesamja/ddfce4b53e668ab10ad8d58444311bf7 to your computer and use it in GitHub Desktop.
Save taesamja/ddfce4b53e668ab10ad8d58444311bf7 to your computer and use it in GitHub Desktop.
int led = 13;
void setup() {
Serial.begin(9600);
pinMode(led, OUTPUT);
}
void loop() {
char indata;
if(Serial.available()) {
indata = Serial.read();
if(indata == 'H')
digitalWrite(led, HIGH);
if(indata == 'L')
digitalWrite(led, LOW);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment