I used this one and it worked great:
I'm not sure which one your using. Regardless perhaps the code I wrote for mine will help you with yours:
#define NUM_DIGITS 4
#define NUM_SEGMENTS 7
const int PIN_DIGITS[] = {3, 5, 6, 9}; //DIGITS 1-4 (PWM)
const int PIN_SEGMENTS[] = {10, 11, 2, 4, 7, 8, 12}; //Segments Bottom-Left going clockwise
//Segments ABCDEF Bottom-Left going clockwise
const String SEG_ALPHA[] = {
"1111101", //A
"1111111", //B
"1110010", //C
"1111110", //D
"1110011", //E
"1110001", //F
"1110111", //G
"1101101", //H
"1100000", //I
"0001110", //J
"1101001", //K
"1100010", //L
"1111100", //M
"1111100", //N
"1111110", //O
"1111001", //P
"1111110", //Q
"1111101", //R
"0110111", //S
"1110000", //T
"1101110", //U
"1101110", //V
"1101110", //W
"1101101", //X
"0101111", //Y
"1011011" //Z
};
const String SEG_NUMS[] = {
"1111110", //0
"0001100", //1
"1011011", //2
"0011111", //3
"0101101", //4
"0110111", //5
"1110111", //6
"0011100", //7
"1111111", //8
"0111111" //9
};
const String SEG_DASH = "0000001"; //-
const String SEG_UNDERSCORE = "0000010"; //_
const String SEG_QMARK = "1011001"; //?
const int DELAY = 3000; //Time to display each digit in Microseconds (there are a thousand microseconds in a millisecond)
//Prototypes
void setup();
void loop();
void display(char value[NUM_DIGITS + 1]);
void displayInt(int i, boolean alignRight = true, char filler = '0');
String parseCharSegment(char c);
//Global variables
boolean sensorHigh = false;
void setup(){
for (int i = 0; i < NUM_DIGITS; i++){
pinMode(PIN_DIGITS[i], OUTPUT);
}
for (int i = 0; i < NUM_SEGMENTS; i++){
pinMode(PIN_SEGMENTS[i], OUTPUT);
}
}
void loop(){
int time = millis() / 1000;
displayInt(time);
}
void displayInt(int i, boolean alignRight, char filler){
String si = String(i);
int siLen = si.length();
if (siLen > NUM_DIGITS){
si = si.substring(0, NUM_DIGITS);
} else if (siLen < NUM_DIGITS){
int diff = NUM_DIGITS - siLen;
for (int i = 0; i < diff; i++){
if (alignRight){
si = filler + si;
} else {
si = si + filler;
}
}
}
char csi[NUM_DIGITS + 1];
si.toCharArray(csi, NUM_DIGITS + 1);
display(csi);
}
void display(char value[NUM_DIGITS + 1]){
for (int i = 0; i < NUM_DIGITS; i++){
String segment = parseCharSegment(value[i]);
if (segment == NULL){
delayMicroseconds(DELAY);
continue;
}
digitalWrite(PIN_DIGITS[i], HIGH);
for (int j = 0; j < NUM_SEGMENTS; j++){ //display char segments on/off
if (segment.substring(j, j + 1) == "0"){
digitalWrite(PIN_SEGMENTS[j], HIGH);
} else {
digitalWrite(PIN_SEGMENTS[j], LOW);
}
}
delayMicroseconds(DELAY);
for (int j = 0; j < NUM_SEGMENTS; j++){ //Segments off
digitalWrite(PIN_SEGMENTS[j], HIGH);
}
digitalWrite(PIN_DIGITS[i], LOW);
}
delayMicroseconds(DELAY);
}
String parseCharSegment(char c){
String segment = NULL;
int ascii = (int)c;
if (ascii >= 48 && ascii <= 57){ //0-9
segment = SEG_NUMS[ascii - 48];
} else if (ascii >= 65 && ascii <= 90){ //A-Z
segment = SEG_ALPHA[ascii - 65];
} else if (ascii >= 97 && ascii <= 122){ //a-z
segment = SEG_ALPHA[ascii - 97];
} else if (ascii == 45){ //-
segment = SEG_DASH;
} else if (ascii == 95){ //_
segment = SEG_UNDERSCORE;
} else if (ascii == 63){ //?
segment = SEG_QMARK;
}
return segment;
}