This may not match the schematic, but something along these lines.
Arrays to define the pins used
Array to define the number font
read a switch - if closed, update the digit for that switch
// pins for the digits, 0,1 reserved for serial
byte digit1Array[7] = {2,3,4,5,6,7,8};
byte digit2Array[7] = {9,10,11,12,13,14,15};
// segmentst light up, 0 = on
byte digitDisplay[10] = {B00000000, B00000110, B010101111, B01100110, B01101101, B011111101, B00000111, B01111111, B011001111;}
// switch pins
byte sw1 = 16;
byte sw2 = 17;
byte sw3 = 18;
byte sw4 = 19;
byte digit1 = 0;
byte digit2 = 0;
updated = 0;
void setup(){
for (int x = 0; x<7; x=x+1){
pinMode(digit1Array[x], OUTPUT);
pinMode(digit2Array[x], OUTPUT);
digitalWrite (digit1Array[x], HIGH);
digitalWrite (digit2Array[x], HIGH);
}
pinMode (sw1,INPUT_PULLUP); // internal pullup, reads high unless switch is closed
pinMode (sw2,INPUT_PULLUP);
pinMode (sw3,INPUT_PULLUP);
pinMode (sw4,INPUT_PULLUP);
Serial.begin(9600);
}
void loop(){
if (digitalRead (sw1) == 0){
updated = 1;
digit1 = digit1+1;
if (digit1 ==10){digit1 = 0;}
for (int x = 0; x<7; x=x+1){
digitalWrite(digit1Array[x], (code here to pick off the High/low for a bit from digitDisplay[digit] for the segment pin - thinking about that still) );
}
}
if (digitalRead (sw2) == 0){
updated = 1;
digit2 = digit2+1;
if (digit2 ==10){digit2 = 0;}
for (int x = 0; x<7; x=x+1){
digitalWrite(digit2Array[x], (code here to pick off the High/low for a bit from digitDisplay[digit] for the segment pin - thinking about that still) );
}
}
if (updated == 1){
updated = 0;
delay(100);} // button debounce delay, there are better ways to do this also
}