1const int A = 2;
2const int B = 3;
3const int C = 4;
4const int D = 5;
5const int E = 6;
6const int F = 7;
7const int G = 8;
8const int DP = 9;
9
10void setup()
11{
12 pinMode (A, OUTPUT);
13 pinMode (B, OUTPUT);
14 pinMode (C, OUTPUT);
15 pinMode (D, OUTPUT);
16 pinMode (E, OUTPUT);
17 pinMode (F, OUTPUT);
18 pinMode (G, OUTPUT);
19 pinMode (DP, OUTPUT);
20}
21
22void loop()
23{
24 zero();
25 delay (1000);
26 one();
27 delay (1000);
28 two();
29 delay (1000);
30 three();
31 delay (1000);
32 four();
33 delay (1000);
34 five();
35 delay (1000);
36 six();
37 delay (1000);
38 seven();
39 delay (1000);
40 eight();
41 delay (1000);
42 nine();
43 delay (1000);
44}
45
46void zero()
47{
48 digitalWrite (A, LOW);
49 digitalWrite (B, LOW);
50 digitalWrite (C, LOW);
51 digitalWrite (D, LOW);
52 digitalWrite (E, LOW);
53 digitalWrite (F, LOW);
54 digitalWrite (G, HIGH);
55 digitalWrite (DP, HIGH);
56}
57
58void one()
59{
60 digitalWrite (A, HIGH);
61 digitalWrite (B, LOW);
62 digitalWrite (C, LOW);
63 digitalWrite (D, HIGH);
64 digitalWrite (E, HIGH);
65 digitalWrite (F, HIGH);
66 digitalWrite (G, HIGH);
67 digitalWrite (DP, HIGH);
68}
69
70void two()
71{
72 digitalWrite (A, LOW);
73 digitalWrite (B, LOW);
74 digitalWrite (C, HIGH);
75 digitalWrite (D, LOW);
76 digitalWrite (E, LOW);
77 digitalWrite (F, HIGH);
78 digitalWrite (G, LOW);
79 digitalWrite (DP, HIGH);
80}
81
82void three()
83{
84 digitalWrite (A, LOW);
85 digitalWrite (B, LOW);
86 digitalWrite (C, LOW);
87 digitalWrite (D, LOW);
88 digitalWrite (E, HIGH);
89 digitalWrite (F, HIGH);
90 digitalWrite (G, LOW);
91 digitalWrite (DP, HIGH);
92}
93
94void four()
95{
96 digitalWrite (A, HIGH);
97 digitalWrite (B, LOW);
98 digitalWrite (C, LOW);
99 digitalWrite (D, HIGH);
100 digitalWrite (E, HIGH);
101 digitalWrite (F, LOW);
102 digitalWrite (G, LOW);
103 digitalWrite (DP, HIGH);
104}
105
106void five()
107{
108 digitalWrite (A, LOW);
109 digitalWrite (B, HIGH);
110 digitalWrite (C, LOW);
111 digitalWrite (D, LOW);
112 digitalWrite (E, HIGH);
113 digitalWrite (F, LOW);
114 digitalWrite (G, LOW);
115 digitalWrite (DP, HIGH);
116}
117
118void six()
119{
120 digitalWrite (A, LOW);
121 digitalWrite (B, HIGH);
122 digitalWrite (C, LOW);
123 digitalWrite (D, LOW);
124 digitalWrite (E, LOW);
125 digitalWrite (F, LOW);
126 digitalWrite (G, LOW);
127 digitalWrite (DP, HIGH);
128}
129
130void seven()
131{
132 digitalWrite (A, LOW);
133 digitalWrite (B, LOW);
134 digitalWrite (C, LOW);
135 digitalWrite (D, HIGH);
136 digitalWrite (E, HIGH);
137 digitalWrite (F, HIGH);
138 digitalWrite (G, HIGH);
139 digitalWrite (DP, HIGH);
140}
141
142void eight()
143{
144 digitalWrite (A, LOW);
145 digitalWrite (B, LOW);
146 digitalWrite (C, LOW);
147 digitalWrite (D, LOW);
148 digitalWrite (E, LOW);
149 digitalWrite (F, LOW);
150 digitalWrite (G, LOW);
151 digitalWrite (DP, HIGH);
152}
153
154void nine()
155{
156 digitalWrite (A, LOW);
157 digitalWrite (B, LOW);
158 digitalWrite (C, LOW);
159 digitalWrite (D, LOW);
160 digitalWrite (E, HIGH);
161 digitalWrite (F, LOW);
162 digitalWrite (G, LOW);
163 digitalWrite (DP, HIGH);
164}