Code:
'
Variables
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
W var Word [8] ' words array
Tcount var Word ' timer count
Ocount var word ' OverFlow timer count
A0 var byte ' general purpose variable
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
W[0] = (Ocount * 5) + Tcount dig 4
W[1] = (Ocount * 3) + Tcount dig 3 + W[0] dig 1
W[2] = (Ocount * 5) + Tcount Dig 2 + W[0] dig 2 + W[1] dig 1
W[3] = (Ocount * 5) + Tcount Dig 1 + W[0] dig 3 + W[1] dig 2 + w[2] dig 1
W[4] = (Ocount * 6) + Tcount Dig 0 + W[1] dig 3 + W[2] dig 2 + W[3] dig 1
W[5] = W[2] dig 3 + W[3] dig 2 + W[4] dig 1
W[5] = W[3] dig 3 + W[4] dig 2 + W[5] dig 1
W[6] = W[4] dig 3 + W[5] dig 2 + W[6] dig 1
W[7] = W[5] dig 3 + W[6] dig 2
For A0 = 7 to 0 step -1
'Display W[A0] Dig 0
Next A0
This code (not tested) should add up (overflow number x 65535) and timer counter and distribute the result into the array in position 0 the number (digit) to be displayed.
Just run a for/next cycle with W[x] Dig 0 and you should display your number on your 8 digits display.
If you need the ascii value then you have to add 48 to every single digit in the for/next loop.
Al.
Last edited by aratti; - 9th July 2009 at 10:03.
All progress began with an idea
Bookmarks