int pins[]={2,4,5,18,19,22,23};
int data[10][7]={
{1,0,0,1,1,1,1},//a,b,c,d,e,f,g(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
{0,0,0,0,0,0,1}//0
};
int y;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
for(int x=0; x<=6; x++)
{
pinMode(pins[x], OUTPUT);
}
}
void loop() {
for(int y=0; y<=9; y++)
{
for(int x=0; x<=6; x++)
{
digitalWrite(pins[x], data[y][x]);
}
Serial.println(y);
delay(1000); // this speeds up the simulation
}
}