PDA

View Full Version : LCDout $FE,2, dec Days - What is dec ?



merc07
- 23rd June 2009, 17:32
I am trying to implement Darryl Taylors interrupt driven timer code.

http://www.picbasic.co.uk/forum/showthread.php?t=190

I have changed the code so it counts the time in milliseconds between 2 inputs instead of days/hours/mins/secs - also the corrosponding lines as well.

LCD output lines....

Original code
LCDout $FE,2, dec Days,"d-",dec2 Hours,":",dec2 Minutes,":",dec2 Seconds

Myline
LCDout $FE,2, dec Ticks," ms"

Ticks now counts 1000/second up to 5000 max - 5secs

The problem I have is with the LCD output. If Ticks value is say 1100, then LCD will only show '11 ms' zeros are always missing. An ouput from other values, for example, 2875 reads fine, ie '2875 ms'

I have tried dec2, dec3, dec4 etc but I'm not 100% sure what dec means and why the zeros are not displayed. There is probably a very simple solution - I hope

Cheers
Adam

merc07
- 23rd June 2009, 19:49
Well I just used the normal # command for the LCDOUT and that works, still not sure about DEC though, can't find a reference to it anywhere ?

LCDout $FE,$C0, "Rider Time :",#Ticks,"ms"

Cheers
Adam

mackrackit
- 24th June 2009, 04:03
still not sure about DEC though, can't find a reference to it anywhere ?

Have you tried looking in the manual under LCDOUT or under SERIN2 or SEROUT2?