Paso 3: Avance
Estaba pensando en un gusano cuando escribí esto.
int led2 = 2;
led3 int = 3; int del = 1000; led4 int = 4; led5 int = 5; led6 int = 6; led7 int = 7; led8 int = 8; led9 int = 9; led10 int = 10; led11 int = 11; led12 INT = 12; int led13 = 13;
la puesta en marcha ejecuta rutina una vez al presionar reset:
void setup () {/ / inicializar el pin digital como oupput.
pinMode (led2, salida); pinMode (led3, salida); pinMode (led4, salida); pinMode (led5, salida); pinMode (led6, salida); pinMode (led7, salida); pinMode (led8, salida); pinMode (led9, salida); pinMode (led10, salida); pinMode (led11, salida); pinMode (led12, salida); pinMode (led13, salida); }
void loop() {digitalWrite (led2, alta); digitalWrite (LED 3, alto); delay(del/4); digitalWrite (led2, baja); digitalWrite (LED 3, bajo); digitalWrite (led4, alta); digitalWrite (led5, alta); delay(del/4); digitalWrite (led2, alto); digitalWrite (LED 3, alto); digitalWrite (led4, baja); digitalWrite (led5, baja); digitalWrite (led6, alta); digitalWrite (led7, alta); delay(del/4); digitalWrite (led2, baja); digitalWrite (LED 3, bajo); digitalWrite (led4, alta); digitalWrite (led5, alta); digitalWrite (led6 BAJA); digitalWrite (led7, LOW); digitalWrite (led8, HIGH); digitalWrite (led9, HIGH); Delay(del/4);
digitalWrite (led2, HIGH); digitalWrite (LED 3, alto); digitalWrite (led4, LOW); digitalWrite (led5, LOW); digitalWrite (led6, HIGH); digitalWrite (led7, HIGH); digitalWrite (led8, LOW); digitalWrite (led9, LOW); digitalWrite (led10, HIGH); digitalWrite (led11, HIGH); Delay(del/4);
digitalWrite (led2, LOW); digitalWrite (LED 3, bajo); digitalWrite (led4, HIGH); digitalWrite (led5, HIGH); digitalWrite (led6, LOW); digitalWrite (led7, LOW); digitalWrite (led8, HIGH); digitalWrite (led9, HIGH); digitalWrite (led10, LOW); digitalWrite (led11, LOW); digitalWrite (led12, HIGH); digitalWrite (led13, HIGH); Delay(del/4); digitalWrite (led2, LOW); digitalWrite (LED 3, bajo); digitalWrite (led4, LOW); digitalWrite (led5, LOW); digitalWrite (led6, LOW); digitalWrite (led7, LOW); digitalWrite (led8, LOW); digitalWrite (led9, LOW); digitalWrite (led10, LOW); digitalWrite (led11, LOW); digitalWrite (led12, LOW); digitalWrite (led13, bajo);
}