Paso 8: hacer. Programación
Felicitaciones estamos listos. Para la programación se puede controlar todo, medio led le puede controlar con su perno. Para todos el otro led de usted pueden utilizar la cuadrícula de transistor y los pernos. Aquí está un ejemplo rápido
neg1 int = 2;
neg2 int = 4; neg3 int = 7; int pos1 = 3; int pos2 = 5; int pos3 = 6; int medio = 9; int cantidad = 0;
void setup() {pinMode (neg1, salida); pinMode (neg2, salida); pinMode (neg3, salida); pinMode (pos1, salida); pinMode (pos2, salida); pinMode (pos3, salida); pinMode (medio, salida); digitalWrite (neg1, HIGH); digitalWrite (pos1, HIGH); digitalWrite (pos2, HIGH); digitalWrite (pos3, HIGH); delay(200) digitalWrite (neg1, bajo) digitalWrite (pos1, baja); digitalWrite (pos2, baja); digitalWrite (pos3, baja); digitalWrite (neg2, alta); digitalWrite (pos1, alta); digitalWrite (medio, alto); digitalWrite (pos3, HIGH); delay(200); digitalWrite (neg2 BAJA); digitalWrite (pos1, LOW); digitalWrite (medio, bajo); digitalWrite (pos3, LOW); digitalWrite (neg3, HIGH); digitalWrite (pos1, HIGH); digitalWrite (pos2, HIGH); digitalWrite (pos3, HIGH); Delay(200); digitalWrite (neg3, LOW); digitalWrite (pos1, LOW); digitalWrite (pos2, LOW); digitalWrite (pos3, LOW); digitalWrite (pos1, HIGH); digitalWrite (neg1, HIGH); digitalWrite (neg2, HIGH); digitalWrite (neg3, HIGH); Delay(200); digitalWrite (pos1, LOW); digitalWrite (neg1, LOW); digitalWrite (neg2, LOW); digitalWrite (neg3, LOW); digitalWrite (pos2, HIGH); digitalWrite (neg1, HIGH); digitalWrite (medio, alto); digitalWrite (neg3, HIGH); Delay(200); digitalWrite (pos2, LOW); digitalWrite (neg1, LOW); digitalWrite (medio, bajo); digitalWrite (neg3, LOW); digitalWrite (pos3, HIGH); digitalWrite (neg1, HIGH); digitalWrite (neg2, HIGH); digitalWrite (neg3, HIGH); Delay(500); digitalWrite (pos3, LOW); digitalWrite (neg1, LOW); digitalWrite (neg2, LOW); digitalWrite (neg3, LOW); digitalWrite (neg1, HIGH); digitalWrite (pos1, HIGH); digitalWrite (pos2, HIGH); digitalWrite (pos3, HIGH); Delay(200); digitalWrite (neg1, LOW); digitalWrite (pos1, LOW); digitalWrite (pos2, LOW); digitalWrite (pos3, LOW); digitalWrite (neg2, HIGH); digitalWrite (pos1, HIGH); digitalWrite (medio, alto); digitalWrite (pos3, HIGH); Delay(200); digitalWrite (neg2, LOW); digitalWrite (pos1, LOW); digitalWrite (medio, bajo); digitalWrite (pos3, LOW); digitalWrite (neg3, HIGH); digitalWrite (pos1, HIGH); digitalWrite (pos2, HIGH); digitalWrite (pos3, HIGH); Delay(200); digitalWrite (neg3, LOW); digitalWrite (pos1, LOW); digitalWrite (pos2, LOW); digitalWrite (pos3, LOW); digitalWrite (pos1, HIGH); digitalWrite (neg1, HIGH); digitalWrite (neg2, HIGH); digitalWrite (neg3, HIGH); Delay(200); digitalWrite (pos1, LOW); digitalWrite (neg1, LOW); digitalWrite (neg2, LOW); digitalWrite (neg3, LOW); digitalWrite (pos2, HIGH); digitalWrite (neg1, HIGH); digitalWrite (medio, alto); digitalWrite (neg3, HIGH); Delay(200); digitalWrite (pos2, LOW); digitalWrite (neg1, LOW); digitalWrite (medio, bajo); digitalWrite (neg3, LOW); digitalWrite (pos3, HIGH); digitalWrite (neg1, HIGH); digitalWrite (neg2, HIGH); digitalWrite (neg3, HIGH); }
void loop() {if(number == 0) {digitalWrite (pos3, LOW); digitalWrite (neg1, LOW); digitalWrite (neg2, LOW); digitalWrite (neg3, LOW); delay(200);} digitalWrite (neg1, HIGH); digitalWrite (pos1, HIGH); digitalWrite (pos2, HIGH); digitalWrite (pos3, HIGH); delay(200) digitalWrite (neg1, bajo) digitalWrite (pos1, baja); digitalWrite (pos2, baja); digitalWrite (pos3, baja); digitalWrite (neg2, alta); digitalWrite (pos1, alta); digitalWrite (medio, alto); digitalWrite (pos3, HIGH); delay(200); digitalWrite (neg2 BAJA); digitalWrite (pos1, LOW); digitalWrite (medio, bajo); digitalWrite (pos3, LOW); digitalWrite (neg3, HIGH); digitalWrite (pos1, HIGH); digitalWrite (pos2, HIGH); digitalWrite (pos3, HIGH); Delay(200); digitalWrite (neg3, LOW); digitalWrite (pos1, LOW); digitalWrite (pos2, LOW); digitalWrite (pos3, LOW);
Delay(200);
}