using a 4 digit LED number display?

I have the following led display from sparkfun.

trying to build a clock for fun.

the issue is I can only get it to display all the same numbers 33:33 44:44 etc...

has anyone used one of these before and have any pointers on how to get different numbers? the spec sheet got me as far as the base numbers, but I can't understand it well enough to see how to do multiple different ones.

thanks!

Your multiplexing the display right?

How do you have it wired up?

no idea what multiplexing is...

ahhh multiplexing!

and for any others wondering...

not sure if I have it hooked up correctly, but now I'm starting to understand the idea of it atleast.... having trouble getting the leds numbers to not all turn off though

Well, that explains why you get what you get. The DISPLAY is wired so all of the LED segments a.b.c.d.e.f.g are wired together on each DIGIT. the other side of the LED segments are wired to a common pin for each digit. When you multiplex, you are only driving one digit at a time... not all at once.

Sequence:

SET A-G SEGMENTS for DIGIT 1
ENABLE COMMON PIN for DIGIT 1
SET A-G SEGMENTS for DIGIT 2
ENABLE COMMON PIN for DIGIT 2
SET A-G SEGMENTS for DIGIT 3
ENABLE COMMON PIN for DIGIT 3
SET A-G SEGMENTS for DIGIT 4
ENABLE COMMON PIN for DIGIT 4
back to digit 1

IN ALL CASES you turn on A-G segments with the same pins. You enable digits with different pins.

Do this REAL FAST and persistence of vision will make it look like they are all on at once.

Rather than my try to explain it... read what this guy wrote:

EDIT: Oh cool, you already found it

OK!
I can display digits seperatly using NPN transisotrs, and I ahve my arduino keeping count, and I have functions that turn on/off LED's to create numbers.

but how to I control the fast switching to generate the persistance of vision?

some example code of what I have that lacks that

static unsigned long lastMilli = 0;

if (millis() - lastMilli >= 1000) {
lastMilli = millis();
second++;

}

if (second >= 60) {
minute++;
second = 0; // reset seconds to zero
}

// move forward one hour every 60 minutes
if (minute >=60) {
hour++;
minute = 0; // reset minutes to zero

}

if (hour >=24) {
hour=0;
minute = 0; // reset minutes to zero
}

munit = minute%10;
hunit = hour%10;

then I control the numbers via

if(munit == 1){
digitalWrite(11, HIGH);
number_one();
}
else if(munit == 2){
digitalWrite(11, HIGH);
number_two();
}

etc.

but that clearly only works for the first digit, not the other 3.

pin11 is used as my transistor pin for the first digit.

pin 12 would be the next digit for going from 9 to 10

thanks for any help

bah! nevermind!

simple delay(8); between number chunks!

yay it works!

You can use microsecond delays instead of millisecond displays...

Mowcius