
Originally Posted by
GrandPa
First of all, I wonder about this line: LCDOUT $FE,$8D, DEC speed, "km/h "
--- > $8D ??? I think you meant $80 (beginning of first line)
Then, if it's the case you can use:
If speed < 100 then X= 1
If speed < 10 then X = 2
LCDOUT $FE,$8D + X, DEC speed, "km/h"
Cleaver!
Whilst that would keep the "km/h" in the same position on the screen it WONT clear text that is previously written which is why you need to print spaces.
With the above code you would get the following
9 would give "9km/h"
49 would give "49km/h"
103 would give "103km/h"
but when the speed drops you would get the following problem due to not clearing the leading digits
87 would give "187km/h" (the "1" not being cleared)
5 would give "185km/h" (both the "1" and the "8" not being cleared)
Last edited by keithdoxey; - 29th July 2007 at 12:29.
Reason: keyboard is getting knackered and some letters were missing!!!!
Keith
www.diyha.co.uk
www.kat5.tv
Bookmarks