int x=0, y=0; // Define the digits for the two displays with x the ones and y the tens.
int D[7]; // The array with the Arduino pin voltage (1 or 0, High or LOW);
int f=4; // Frequency of the display in Hz (s^-1);
void setup() {
for(int i=0;i<=13;i++){
pinMode(i,OUTPUT);} // Pins for the two displays.
}
void loop() {
while(y<=9){
while(x<=9){
display(x);
for (int j=0;j<=6;j++){digitalWrite(j,D[j]);} //Pins 0 to 6 are connected to display x
display(y);
for (int j=0;j<=6;j++){digitalWrite(j+7,D[j]);} //Pins 7 to 13 are connected to display y
delay(1000/f); // The delay command receives the time in milli-seconds
x=x+1;
if(x==10){
x=0;y=y+1;
if(y==10){y=0;}}
}// End of while(x<=9)
}// End of while(y<=9)
}//End of loop
// "display" is a function that defines the voltage level on the pins for an input decimal number z
void display(int z){
if (z==0){int temp[]={1,1,1,1,1,1,0};for(int j=0;j<=6;j++){D[j]=temp[j];}}
else if (z==1){int temp[]={0,1,1,0,0,0,0};for(int j=0;j<=6;j++){D[j]=temp[j];}}
else if (z==2){int temp[]={1,1,0,1,1,0,1};for(int j=0;j<=6;j++){D[j]=temp[j];}}
else if (z==3){int temp[]={1,1,1,1,0,0,1};for(int j=0;j<=6;j++){D[j]=temp[j];}}
else if (z==4){int temp[]={0,1,1,0,0,1,1};for(int j=0;j<=6;j++){D[j]=temp[j];}}
else if (z==5){int temp[]={1,0,1,1,0,1,1};for(int j=0;j<=6;j++){D[j]=temp[j];}}
else if (z==6){int temp[]={1,0,1,1,1,1,1};for(int j=0;j<=6;j++){D[j]=temp[j];}}
else if (z==7){int temp[]={1,1,1,0,0,0,0};for(int j=0;j<=6;j++){D[j]=temp[j];}}
else if (z==8){int temp[]={1,1,1,1,1,1,1};for(int j=0;j<=6;j++){D[j]=temp[j];}}
else if (z==9){int temp[]={1,1,1,1,0,1,1};for(int j=0;j<=6;j++){D[j]=temp[j];}}
}