Created
October 23, 2018 13:35
-
-
Save ugeugeHigh/bfd0e841e1792ba958efb8f22ebf8f72 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int val = 0; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(2, HIGH); | |
} | |
void loop() { | |
if(Serial.available() > 0) { | |
val = Serial.read(); | |
if(val == 48){ | |
digitalWrite(2, LOW); | |
Serial.println("LED OFF"); | |
}else if(val = 49){ | |
digitalWrite(2, HIGH); | |
Serial.println("LED ON"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment