Skip to content

Instantly share code, notes, and snippets.

@nilsonpessim
Last active August 29, 2015 13:57
Show Gist options
  • Save nilsonpessim/9794499 to your computer and use it in GitHub Desktop.
Save nilsonpessim/9794499 to your computer and use it in GitHub Desktop.
int led = 13;
int estado = LOW;
char leitura;
void setup(){
Serial.begin(9600);
pinMode(led, OUTPUT);
}
void loop(){
if(Serial.available()){
leitura = Serial.read();
if(leitura == 'a'){
estado = !estado;
}
}
digitalWrite(led, estado);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment