Created
March 24, 2018 03:03
-
-
Save samuelsonbrito/93c37dfb323e71ff622838123d4e5a22 to your computer and use it in GitHub Desktop.
Liga led arduino
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 statusLed = 0; | |
const int LED = 12; | |
void setup(){ | |
Serial.begin(9600); | |
pinMode(LED,OUTPUT); | |
digitalWrite(LED,LOW); | |
} | |
void loop(){ | |
if (Serial.available()>0){ | |
statusLed = Serial.read(); | |
if(statusLed == '0'){ | |
digitalWrite(LED,LOW); | |
}else if(statusLed == '1'){ | |
digitalWrite(LED,HIGH); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment