const int A = 2;
const int B = 3;
const int C = 4;
const int D = 5;
const int E = 6;
const int F = 7;
const int G = 8;
const int DP = 9;
void setup()
{
pinMode (A, OUTPUT);
pinMode (B, OUTPUT);
pinMode (C, OUTPUT);
pinMode (D, OUTPUT);
pinMode (E, OUTPUT);
pinMode (F, OUTPUT);
pinMode (G, OUTPUT);
pinMode (DP, OUTPUT);
}
void loop()
{
zero();
delay (1000);
one();
delay (1000);
two();
delay (1000);
three();
delay (1000);
four();
delay (1000);
five();
delay (1000);
six();
delay (1000);
seven();
delay (1000);
eight();
delay (1000);
nine();
delay (1000);
}
void zero()
{
digitalWrite (A, LOW);
digitalWrite (B, LOW);
digitalWrite (C, LOW);
digitalWrite (D, LOW);
digitalWrite (E, LOW);
digitalWrite (F, LOW);
digitalWrite (G, HIGH);
digitalWrite (DP, HIGH);
}
void one()
{
digitalWrite (A, HIGH);
digitalWrite (B, LOW);
digitalWrite (C, LOW);
digitalWrite (D, HIGH);
digitalWrite (E, HIGH);
digitalWrite (F, HIGH);
digitalWrite (G, HIGH);
digitalWrite (DP, HIGH);
}
void two()
{
digitalWrite (A, LOW);
digitalWrite (B, LOW);
digitalWrite (C, HIGH);
digitalWrite (D, LOW);
digitalWrite (E, LOW);
digitalWrite (F, HIGH);
digitalWrite (G, LOW);
digitalWrite (DP, HIGH);
}
void three()
{
digitalWrite (A, LOW);
digitalWrite (B, LOW);
digitalWrite (C, LOW);
digitalWrite (D, LOW);
digitalWrite (E, HIGH);
digitalWrite (F, HIGH);
digitalWrite (G, LOW);
digitalWrite (DP, HIGH);
}
void four()
{
digitalWrite (A, HIGH);
digitalWrite (B, LOW);
digitalWrite (C, LOW);
digitalWrite (D, HIGH);
digitalWrite (E, HIGH);
digitalWrite (F, LOW);
digitalWrite (G, LOW);
digitalWrite (DP, HIGH);
}
void five()
{
digitalWrite (A, LOW);
digitalWrite (B, HIGH);
digitalWrite (C, LOW);
digitalWrite (D, LOW);
digitalWrite (E, HIGH);
digitalWrite (F, LOW);
digitalWrite (G, LOW);
digitalWrite (DP, HIGH);
}
void six()
{
digitalWrite (A, LOW);
digitalWrite (B, HIGH);
digitalWrite (C, LOW);
digitalWrite (D, LOW);
digitalWrite (E, LOW);
digitalWrite (F, LOW);
digitalWrite (G, LOW);
digitalWrite (DP, HIGH);
}
void seven()
{
digitalWrite (A, LOW);
digitalWrite (B, LOW);
digitalWrite (C, LOW);
digitalWrite (D, HIGH);
digitalWrite (E, HIGH);
digitalWrite (F, HIGH);
digitalWrite (G, HIGH);
digitalWrite (DP, HIGH);
}
void eight()
{
digitalWrite (A, LOW);
digitalWrite (B, LOW);
digitalWrite (C, LOW);
digitalWrite (D, LOW);
digitalWrite (E, LOW);
digitalWrite (F, LOW);
digitalWrite (G, LOW);
digitalWrite (DP, HIGH);
}
void nine()
{
digitalWrite (A, LOW);
digitalWrite (B, LOW);
digitalWrite (C, LOW);
digitalWrite (D, LOW);
digitalWrite (E, HIGH);
digitalWrite (F, LOW);
digitalWrite (G, LOW);
digitalWrite (DP, HIGH);
}
Comments