Ttelmah
Joined: 11 Mar 2010 Posts: 19537
|
|
Posted: Mon Jan 07, 2013 4:35 am |
|
|
Look, seriously, think...
0 to 99. One line of code a for loop.
The hard part is the display itself, and this is not generic. A 'seven segment' display, can immediately be common cathode or common anode. Two different connection patterns, while the digit output will depend totally on the connections _you_ choose. The display can also be static or multiplexed. A total of _billions_ of total combinations possible....
If you search the forum, you will find threads about how to drive seven segment displays, including how to make the code easier with lookup tables for the bits to be driven, and using a timer interrupt if the display is multiplexed. Find one of these that is close to your hardware, and either modify it to match your hardware, or modify your hardware to match it.
Once you have the display going, then add the line to count.
There is no 'generic' solution to this.
Best Wishes |
|