Skip to content

Instantly share code, notes, and snippets.

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