   unsigned long now = millis();
   if (now > lastIncrement + 20)
   {
-    valueToDisplay++;
+    valueToDisplay = (valueToDisplay + 1) % 10000;
     lastIncrement = now;
   }
+
+  digitalWrite(ledPin, (now % 200 == 0) ? HIGH : LOW);
 }
 
 void writeValue(byte digit, byte value)

#include <arduino.h>

// shared pins
int outputDisabledPin = 9;
int registerClockPin = 10;

// segment pins
int whichSegmentData = 2; 
int segmentShiftRegisterClockPin = 4;

// digit pins
int whichDigitData = 11;
int shiftRegisterClockPin = 12;

const int segTop = (1 << 0);
const int segDot = (1 << 1);
const int segMiddle = (1 << 2);
const int segBottomRight = (1 << 3);
const int segBottomLeft = (1 << 4);
const int segBottom = (1 << 5);
const int segTopLeft = (1 << 6);
const int segTopRight = (1 << 7);

byte segmentIndex = 0;
int valueToDisplay = 0;

  int segmentData = digitValues[value];
  
  shiftOut(whichSegmentData, segmentShiftRegisterClockPin, MSBFIRST, segmentData);
  shiftOut(whichDigitData, digitShiftRegisterClockPin, MSBFIRST, digitData);

  digitalWrite(registerClockPin, HIGH);
  digitalWrite(registerClockPin, LOW);
