// C++ code
//
int ledR= 12;
int ledA =9;
int ledV=6;
int pulsador=3;
void setup()
{
pinMode (ledR,OUTPUT) ;
pinMode (ledA,OUTPUT) ;
pinMode (ledV,OUTPUT) ;
pinMode (pulsador,INPUT) ;
}
void loop()
{
while (digitalRead(pulsador))
{
digitalWrite(ledV,HIGH);
digitalWrite(ledA,LOW);
digitalWrite(ledR,LOW);
}
digitalWrite(ledV,LOW);
digitalWrite(ledA,HIGH);
digitalWrite(ledR,LOW);
delay (1500);
digitalWrite(ledV,LOW);
digitalWrite(ledA,LOW);
digitalWrite(ledR,HIGH);
delay (4000);
digitalWrite(ledV,HIGH);
digitalWrite(ledA,LOW);
digitalWrite(ledR,LOW);
delay (4000);
}
No hay comentarios.:
Publicar un comentario