View previous topic :: View next topic |
Author |
Message |
leflau42
Joined: 18 Sep 2017 Posts: 3
|
I have 5x 7-segment display, help me |
Posted: Mon Sep 18, 2017 2:46 am |
|
|
I have 5x 7-segment display and i want to this to display in order active.
Example:
Data = 1 // Active First digit
data = 10 // active second digit
data=100 // active thirth digit
data=1000 // active fourth digit
data=10000 // active fifth digit
How can I do that ?
I want do 0-99999 counter application.
I am sorry for bad english. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Mon Sep 18, 2017 5:10 am |
|
|
Good place to start is here !! Learn to use the 'search' function of this website. There are LOTS of 'threads' about creating an LED multiplex display program.
Some comments..
1) the 'refresh' rate( speed of the overall loop) needs to be 50Hz or faster. Too slow and you'll see the segments change.
2) be careful selecting LED current. A 'multiplex' display needs more current than a 'static' one,so you'll need transistor drivers for each display.
Jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19515
|
|
Posted: Mon Sep 18, 2017 5:57 am |
|
|
and (of course), there is an example for a 2 digit display supplied with the compiler (EX_LED.C).
Like all programming, you need to subdivide.
Start by driving one display. Then how to multiplex and do two. This is then easy to expand to do five.
The splitting of the counter number into digits, is only a matter of repeated /10 operations. Look at ldiv, which gives you the quotient and remainder. Remarkably useful for this.... |
|
|
leflau42
Joined: 18 Sep 2017 Posts: 3
|
|
Posted: Mon Oct 02, 2017 12:54 am |
|
|
Thank you guys i solved the problem |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19515
|
|
Posted: Mon Oct 02, 2017 2:28 am |
|
|
Well done. |
|
|
|