int a = 4;
int b = 5;
int c = 6;
int d = 7;
int e = 8;
int f = 9;
int g = 10;
const byte interruptPin = 2;
volatile byte state = LOW;
int i = 0;
int j = 0;
int digitPins[7] = {a,b,c,d,e,f,g};
int segmentPins[10][7] = {{0,0,0,0,0,0,1}, // 0
{1,0,0,1,1,1,1}, // 1
{0,0,1,0,0,1,0}, // 2
{0,0,0,0,1,1,0}, // 3
{1,0,0,1,1,0,0}, // 4
{0,1,0,0,1,0,0}, // 5
{0,1,0,0,0,0,0}, // 6
{0,0,0,1,1,1,1}, // 7
{0,0,0,0,0,0,0}, // 8
{0,0,0,0,1,0,0}}; // 9
void setup() {
// put your setup code here, to run once:
for (int i = 4; i <= 10; i++)
{
pinMode(i, OUTPUT);
}
pinMode(2, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
for (int j = 0; j < 7; j++)
{
digitalWrite(digitPins[j], segmentPins[i][j]);
}
if(digitalRead(2) == 0)
{
while (digitalRead(2) == 0)
{
}
delay(250);
i++;
}
if (i == 10)
{
i = 0;
}
}
uno1:A5.2
uno1:A4.2
uno1:AREF
uno1:GND.1
uno1:13
uno1:12
uno1:11
uno1:10
uno1:9
uno1:8
uno1:7
uno1:6
uno1:5
uno1:4
uno1:3
uno1:2
uno1:1
uno1:0
uno1:IOREF
uno1:RESET
uno1:3.3V
uno1:5V
uno1:GND.2
uno1:GND.3
uno1:VIN
uno1:A0
uno1:A1
uno1:A2
uno1:A3
uno1:A4
uno1:A5
sevseg1:COM.1
sevseg1:COM.2
sevseg1:A
sevseg1:B
sevseg1:C
sevseg1:D
sevseg1:E
sevseg1:F
sevseg1:G
sevseg1:DP
r1:1
r1:2
btn1:1.l
btn1:2.l
btn1:1.r
btn1:2.r
btn2:1.l
btn2:2.l
btn2:1.r
btn2:2.r