Created
May 2, 2012 12:38
-
-
Save mehulved/2576270 to your computer and use it in GitHub Desktop.
Goes to high but doesn't return back to low
This file contains hidden or 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 led = 13; | |
char ledValue; | |
void setup() { | |
Serial.begin(9600); | |
Serial.println("Enter H to turn on the LED and L to turn it off"); | |
} | |
void loop() { | |
Serial.println(digitalRead(led)); | |
delay(1000); | |
} | |
void serialEvent() { | |
if (Serial.read() == 'H' || Serial.read() == 'h') { | |
digitalWrite(led, HIGH); | |
} | |
if (Serial.read() == 'L' || Serial.read() == 'l') { | |
digitalWrite(led, LOW); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment