Pages: [1]   Go Down
Author Topic: using a 4 digit LED number display?  (Read 2907 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have the following led display from sparkfun.
http://www.sparkfun.com/commerce/product_info.php?products_id=9214

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!
« Last Edit: July 06, 2009, 11:03:33 am by fyrebug » Logged

London, England
Offline Offline
Edison Member
*
Karma: 4
Posts: 1026
Go! Go! Arduinoooo !!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Your multiplexing the display right?

How do you have it wired up?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

no idea what multiplexing is...
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ahhh multiplexing!
http://www.youritronics.com/seven-segment-display-explained/

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
Logged

Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1655
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

http://www.youritronics.com/seven-segment-display-explained/

EDIT:  Oh  cool, you already found it
« Last Edit: July 06, 2009, 01:43:19 pm by pwillard » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

bah! nevermind!

simple delay(smiley-cool; between number chunks!

yay it works!
Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Mowcius
Logged

Pages: [1]   Go Up
Jump to: