Paso 4: El programa código
Aquí está el código:
void setup() {}
pinMode (13, salida);
pinMode (12, salida);
pinMode (11, salida);
pinMode (10, salida);
pinMode (9, salida);
pinMode (8, salida);
pinMode (7, salida);
pinMode (6, salida);
}
void loop() {}
One();
Delay(1000);
OFF();
Two();
Delay(1000);
OFF();
Three();
Delay(1000);
OFF();
Four();
Delay(1000);
OFF();
Five();
Delay(1000);
OFF();
Six();
Delay(1000);
OFF();
Seven();
Delay(1000);
OFF();
Eight();
Delay(1000);
OFF();
Nine();
Delay(1000);
OFF();
Zero();
Delay(1000);
OFF();
Point();
Delay(5000);
OFF();
}
void one() {}
digitalWrite (6, alto);
digitalWrite (11, alto);
}
void two() {}
digitalWrite (7, alto);
digitalWrite (6, alto);
digitalWrite (9, alto);
digitalWrite (13, HIGH);
digitalWrite (12, HIGH);
}
void three() {}
digitalWrite (11, alto);
digitalWrite (12, HIGH);
digitalWrite (7, alto);
digitalWrite (6, alto);
digitalWrite (9, alto);
}
void four() {}
digitalWrite (11, alto);
digitalWrite (8, HIGH);
digitalWrite (6, alto);
digitalWrite (9, alto);
}
void five() {}
digitalWrite (11, alto);
digitalWrite (12, HIGH);
digitalWrite (7, alto);
digitalWrite (8, HIGH);
digitalWrite (9, alto);
}
void six() {}
digitalWrite (13, HIGH);
digitalWrite (12, HIGH);
digitalWrite (11, alto);
digitalWrite (9, alto);
digitalWrite (8, HIGH);
digitalWrite (7, alto);
}
void seven() {}
digitalWrite (11, alto);
digitalWrite (7, alto);
digitalWrite (6, alto);
}
void eight() {}
digitalWrite (13, HIGH);
digitalWrite (12, HIGH);
digitalWrite (11, alto);
digitalWrite (9, alto);
digitalWrite (8, HIGH);
digitalWrite (7, alto);
digitalWrite (6, alto);
}
void nine() {}
digitalWrite (12, HIGH);
digitalWrite (11, alto);
digitalWrite (9, alto);
digitalWrite (8, HIGH);
digitalWrite (7, alto);
digitalWrite (6, alto);
}
void zero() {}
digitalWrite (13, HIGH);
digitalWrite (12, HIGH);
digitalWrite (11, alto);
digitalWrite (8, HIGH);
digitalWrite (7, alto);
digitalWrite (6, alto);
}
void point() {}
digitalWrite (10, HIGH);
}
{} void off()
digitalWrite (13, bajo);
digitalWrite (12, bajo);
digitalWrite (11, bajo);
digitalWrite (10, bajo);
digitalWrite (9, bajo);
digitalWrite (8, bajo);
digitalWrite (7, bajo);
digitalWrite (6, bajo);
}