Sorry, the above code should be:
Code:LCDOUT $fe, ($c0 + 4) 'moves cursor to 4th character position on bottom line gosub printtemp printtemp: LCDOUT #TempTens, #TempUnits,".",#TempDecimals 'remove line/cursor info return
Sorry, the above code should be:
Code:LCDOUT $fe, ($c0 + 4) 'moves cursor to 4th character position on bottom line gosub printtemp printtemp: LCDOUT #TempTens, #TempUnits,".",#TempDecimals 'remove line/cursor info return
Last edited by ScaleRobotics; - 28th April 2009 at 20:54.
You know... you might have something going here. I'll explore this option as well.
Now that I think of it, the original way might work as well. I'm just worried about the size of the program (trying to fit everything on a F628) but now that I think about it, just because a variable looks long and messy on the Microcode screen, doesn't mean it will take that much space on a chip, right?
![]()
That's right, looks can be deceiving.
I did a couple tests with Darrel's "How much code could a code hog ...." thread at
http://www.picbasic.co.uk/forum/showthread.php?t=2418
This was done with a 18F chip:
it turns out that both lines use the same amount of space:
And, if you use the gosub (in post #5) 3 times, rather than use the above line (three times), you will use about 2/3 the code space. And that's not considering forming the data into a string.Code:Lcdout $fe, ($c0 +4),"98.7" LCDOUT $fe, ($c0 +4), #TempTens, #TempUnits,".",#TempDecimals
Last edited by ScaleRobotics; - 29th April 2009 at 00:51.
Good stuff. Thank you for running the tests for me.
Looks like I'll have to go with the original plan as you have suggested.
No worries... I simply thought there would be a different way of doing it but I'll just have to get creative here and make efficient use of code space.
Thank you very much for all your help.
Bookmarks