CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

I have 5x 7-segment display, help me

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
leflau42



Joined: 18 Sep 2017
Posts: 3

View user's profile Send private message

I have 5x 7-segment display, help me
PostPosted: Mon Sep 18, 2017 2:46 am     Reply with quote

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: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Sep 18, 2017 5:10 am     Reply with quote

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: 19195

View user's profile Send private message

PostPosted: Mon Sep 18, 2017 5:57 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Oct 02, 2017 12:54 am     Reply with quote

Thank you guys i solved the problem
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Mon Oct 02, 2017 2:28 am     Reply with quote

Well done. Smile
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group