Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int led = 9;
- int numero = -1;
- void setup(){
- pinMode(led,OUTPUT);
- Serial.begin(9600);
- }
- void loop(){
- if (Serial.available() > 0){
- numero = Serial.read();
- }
- if (numero == 49){
- digitalWrite(led,HIGH);
- Serial.println("Ligado");
- delay(200);
- }
- else
- if (numero == 48){
- digitalWrite(led,LOW);
- Serial.println("Desligado");
- delay(200);
- }
- numero = -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement