Materiales:
-ArduinoUno
-Cable USB
-Protoboard
-6 LEDS
-Cables Dupont
-6 resistencias 220 ohm
Código:
int pinArray[] = {2, 3, 4, 5, 6, 7};
int count = 0;
int timer = 100;
void setup(){
for (count=0;count<6;count++)
{
pinMode(pinArray[count], OUTPUT);
}
}
void loop() {
for (count=0;count<6;count++)
{
digitalWrite(pinArray[count], HIGH);
delay(timer);
digitalWrite(pinArray[count], LOW);
delay(timer);
}
for (count=5;count>=0;count--)
{
digitalWrite(pinArray[count], HIGH);
delay(timer);
digitalWrite(pinArray[count], LOW);
delay(timer);
}
}
Foto:
No hay comentarios:
Publicar un comentario