int pin[] = {2, 3, 4, 5, 6, 7, 8, 9};
byte digits [16][8] = {
// dp,a,b,c,d,e,f,g
{0,1,1,1,1,1,1,0},//0
{0,0,1,1,0,0,0,0},//1
{0,1,1,0,1,1,0,1},//2
{0,1,1,1,1,0,0,1},//3
{0,0,1,1,0,0,1,1},//4
{0,1,0,1,1,0,1,1},//5
{0,1,0,1,1,1,1,1},//6
{0,1,1,1,0,0,0,0},//7
{0,1,1,1,1,1,1,1},//8
{0,1,1,1,1,0,1,1},//9
{0,1,1,1,0,1,1,1},//a
{0,0,0,1,1,1,1,1},//b
{0,1,0,0,1,1,1,0},//c
{0,0,1,1,1,1,0,1},//d
{0,1,0,0,1,1,1,1},//e
{0,1,0,0,0,1,1,1},//f
};
void setup() {
//Put your setup code here, to run once:
for(int i = 0; i < 8; i++){
pinMode(pin[i], OUTPUT);
}
}
void loop() {
//Put your main code here, to run repeatedly:
for(int a=0; a<16; a++){
for(int b=0; b<8; b++){
digitalWrite(pin[b], digits[a][b]);
}
delay(1000);
}
}