Jueves 27 de julio de 2023
- Ejercicio 11: Contador de 0-9 (Simulador)
int medio = 13;
int ia = 12;
int a = 11;
int da = 10;
int iab = 9;
int ab = 8;
int dab = 7;
void setup() {
pinMode(medio, OUTPUT);
pinMode(ia, OUTPUT);
pinMode(a, OUTPUT);
pinMode(da, OUTPUT);
pinMode(iab, OUTPUT);
pinMode(ab, OUTPUT);
pinMode(dab, OUTPUT);
}
void loop() {
digitalWrite(medio, HIGH); //0
digitalWrite(ia, LOW);
digitalWrite(a, LOW);
digitalWrite(da, LOW);
digitalWrite(iab, LOW);
digitalWrite(ab, LOW);
digitalWrite(dab, LOW);
delay(1000);
digitalWrite(medio, HIGH); //1
digitalWrite(ia, HIGH);
digitalWrite(a, HIGH);
digitalWrite(da, LOW);
digitalWrite(iab, HIGH);
digitalWrite(ab, HIGH);
digitalWrite(dab, LOW);
delay(1000);
digitalWrite(medio, LOW); //2
digitalWrite(ia, HIGH);
digitalWrite(a, LOW);
digitalWrite(da, LOW);
digitalWrite(iab, LOW);
digitalWrite(ab, LOW);
digitalWrite(dab, HIGH);
delay(1000);
digitalWrite(medio, LOW); //3
digitalWrite(ia, HIGH);
digitalWrite(a, LOW);
digitalWrite(da, LOW);
digitalWrite(iab, HIGH);
digitalWrite(ab, LOW);
digitalWrite(dab, LOW);
delay(1000);
digitalWrite(medio, LOW); //4
digitalWrite(ia, LOW);
digitalWrite(a, HIGH);
digitalWrite(da, LOW);
digitalWrite(iab, HIGH);
digitalWrite(ab, HIGH);
digitalWrite(dab, LOW);
delay(1000);
digitalWrite(medio, LOW); //5
digitalWrite(ia, LOW);
digitalWrite(a, LOW);
digitalWrite(da, HIGH);
digitalWrite(iab, HIGH);
digitalWrite(ab, LOW);
digitalWrite(dab, LOW);
delay(1000);
digitalWrite(medio, LOW); //6
digitalWrite(ia, LOW);
digitalWrite(a, LOW);
digitalWrite(da, HIGH);
digitalWrite(iab, LOW);
digitalWrite(ab, LOW);
digitalWrite(dab, LOW);
delay(1000);
digitalWrite(medio, HIGH); //7
digitalWrite(ia, HIGH);
digitalWrite(a, LOW);
digitalWrite(da, LOW);
digitalWrite(iab, HIGH);
digitalWrite(ab, HIGH);
digitalWrite(dab, LOW);
delay(1000);
digitalWrite(medio, LOW); //8
digitalWrite(ia, LOW);
digitalWrite(a, LOW);
digitalWrite(da, LOW);
digitalWrite(iab, LOW);
digitalWrite(ab, LOW);
digitalWrite(dab, LOW);
delay(1000);
digitalWrite(medio, LOW); //9
digitalWrite(ia, LOW);
digitalWrite(a, LOW);
digitalWrite(da, LOW);
digitalWrite(iab, HIGH);
digitalWrite(ab, LOW);
digitalWrite(dab, LOW);
delay(1000);
}
- Ejercicio 11: Contador de 0-9 (Armado físicamente)
----------------------------------*************----------------------------------