Skip to content

Instantly share code, notes, and snippets.

@taesamja
Created January 5, 2017 04:23
Show Gist options
  • Save taesamja/661c7a651ef016d2f1ac192166c8bd2f to your computer and use it in GitHub Desktop.
Save taesamja/661c7a651ef016d2f1ac192166c8bd2f 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 ind = Serial.read();
if(ind == 'H' || ind == 'h')
digitalWrite(light, HIGH);
if(ind == 'L' || ind == 'l')
digitalWrite(light, LOW);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment