Skip to content

Instantly share code, notes, and snippets.

@taesamja
Created January 5, 2017 05:51
Show Gist options
  • Save taesamja/3e8b624cb1756a046372442c51d837ce to your computer and use it in GitHub Desktop.
Save taesamja/3e8b624cb1756a046372442c51d837ce to your computer and use it in GitHub Desktop.
int led = 13;
void setup() {
Serial.begin(9600);
pinMode(led, OUTPUT);
}
void loop() {
if(Serial.available()) {
char 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