Código:
int led = 4;
int led2 = 8;
led3 int = 5;
led4 int = 2; int b = 7;
void setup() {}
pinMode(led,OUTPUT);
pinMode(led2,OUTPUT);
pinMode(led3,OUTPUT);
pinMode(led4,OUTPUT);
pinMode(b,INPUT);
}
void loop() {si ({digitalRead(b)==HIGH)}
digitalWrite(led,HIGH);
Delay(1000); digitalWrite(led2,HIGH);
Delay(1000); digitalWrite(led3,HIGH);
Delay(1000); digitalWrite(led4,HIGH);
Delay(1000); digitalWrite(led,LOW);
Delay(1000); digitalWrite(led2,LOW);
Delay(1000); digitalWrite(led3,LOW);
Delay(1000); digitalWrite(led4,LOW);
Delay(1000); }}