Skip to content

Instantly share code, notes, and snippets.

@taesamja
Created January 6, 2017 00:18
Show Gist options
  • Save taesamja/533978aa81aaee139122c8108ef0fb4b to your computer and use it in GitHub Desktop.
Save taesamja/533978aa81aaee139122c8108ef0fb4b to your computer and use it in GitHub Desktop.
int light = 9;
void setup() {
Serial.begin(9600);
pinMode(light, OUTPUT);
}
void loop() {
if(Serial.available()) {
char indata = Serial.read();
if(indata == 'H')
digitalWrite(light, HIGH);
if(indata == 'L')
digitalWrite(light, LOW);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment