Skip to content

Instantly share code, notes, and snippets.

@samuelsonbrito
Created March 24, 2018 03:03
Show Gist options
  • Save samuelsonbrito/93c37dfb323e71ff622838123d4e5a22 to your computer and use it in GitHub Desktop.
Save samuelsonbrito/93c37dfb323e71ff622838123d4e5a22 to your computer and use it in GitHub Desktop.
Liga led arduino
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