// El pin 13 tiene conectado un LED en la mayoría de tarjetas Arduino
// ponle un nombre:
int led = 7;
int led2 = 8;
int led3 = 9;
// la rutina de configuración corre sólo una vez
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
}
// la rutina loop se repite una y otra vez
void loop() {
digitalWrite(led, HIGH); // enciende el LED (HIGH es el nivel del voltaje)
delay(100); // espera un segundo
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
digitalWrite(led2, HIGH); // enciende el LED (HIGH es el nivel del voltaje)
delay(100); // espera un segundo
digitalWrite(led2, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
digitalWrite(led3, HIGH); // enciende el LED (HIGH es el nivel del voltaje)
delay(100); // espera un segundo
digitalWrite(led3, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
}

No hay comentarios:
Publicar un comentario