Eliminating Lead Zero (DEC3)
hmlittle59
Posts: 404
in BASIC Stamp
Hello All,
I'm using the BS2p 48 pin/Parallel Display. I've spent 3 to 4 hrs of Google, Parallax/Forum and Editor Help trying to figure out how to strip off the Lead Zero.
My routine is counting by 10's from 10 to 250 with roll over up or down smoothly. The 2 routines, in 2 different Slots that need this code added onto it have less then 32 Bytes FREE. After studying the Sample code from the Forum, it just would not fit.
Then a Light Bulb came on.
With the Speed of the MC and Display, I tried a work around. Instead of converting the Decimal value to ASCII and then stripping ASCII '0', I added code to look for the "counter < 9" and print to the LCD Screen a " "/blank spot just after the DEC3 "value" print. So far so good in both locations(up/down counter & MainMenu). I've gone back and removed the blank and added the same characters as though it is normal program flow.
With minimal code space left, this was my only option. One Slot will need some tweaking because I'm 5 bytes short. But the concept is working.
On wards and Up wards
I'm using the BS2p 48 pin/Parallel Display. I've spent 3 to 4 hrs of Google, Parallax/Forum and Editor Help trying to figure out how to strip off the Lead Zero.
My routine is counting by 10's from 10 to 250 with roll over up or down smoothly. The 2 routines, in 2 different Slots that need this code added onto it have less then 32 Bytes FREE. After studying the Sample code from the Forum, it just would not fit.
Then a Light Bulb came on.
With the Speed of the MC and Display, I tried a work around. Instead of converting the Decimal value to ASCII and then stripping ASCII '0', I added code to look for the "counter < 9" and print to the LCD Screen a " "/blank spot just after the DEC3 "value" print. So far so good in both locations(up/down counter & MainMenu). I've gone back and removed the blank and added the same characters as though it is normal program flow.
AUXIO ' Switch to I/O bank1 IF menu <> 5 THEN skipper1 ' Display Delay Time Value on LCD Screen LCDCMD LCD_Enable, LcdOn ' MUST Be HERE after "m" is printed PAUSE 5 ' tmpB3 = delaymins * 10 ' Multi. by 10 FOR DISPLAY PURPOSE ONLY LCDOUT LCD_Enable, LcdDDRAM + 12, [DEC3 tmpB3,"m"] ' Print on LCD + OFF Set PAUSE 5 ' IF delaymins < 9 THEN LCDOUT LCD_Enable, LcdDDRAM + 12, ["-"]'[DEC3 tmpB3,"m"] ' Print on LCD + OFF Set PAUSE 5 ' skipper1: '
With minimal code space left, this was my only option. One Slot will need some tweaking because I'm 5 bytes short. But the concept is working.
On wards and Up wards