Skip to content

Instantly share code, notes, and snippets.

@nilsonpessim
Last active March 7, 2016 20:29
Show Gist options
  • Save nilsonpessim/9193244 to your computer and use it in GitHub Desktop.
Save nilsonpessim/9193244 to your computer and use it in GitHub Desktop.
int led = 13;
void setup(){
Serial.begin(9600);
pinMode(led,OUTPUT);
}
void loop(){
char caracter = Serial.read();
if (caracter == '1') {
digitalWrite(led,HIGH);
}
if (caracter == '2') {
digitalWrite(led,LOW);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment