Odd lcd values on 2nd line of axe133

moorea21

Senior Member
This code

main:
b0 = 100
b1 = 200
b2 = 300
b3 = 400
serout C.5,N2400,(254,128)
serout C.5,N2400,("b0= ", #b0, " ")
serout C.5,N2400,(254,192)
serout C.5,N2400,("b2= ", #b2, " ")
serout C.5,N2400,(254,137)
serout C.5,N2400,("b1= ", #b1)
serout C.5,N2400,(254,201)
serout C.5,N2400,("b3= ", #b3)
goto main

Gives this result

b0= 100 b1 = 200
b2= 44 ab3= 144

Why? I know the 'a' is left over from the word 'picaxe' when the 20m2 and lcd boot up, but why the bizarre values for 2 vars?
 
Last edited:

hippy

Ex-Staff (retired)
It's probably the -

serout C.5,N2400,(254,192)
serout C.5,N2400,("b2= ", #b2, " ")
serout C.5,N2400,(254,201)
serout C.5,N2400,("b3= ", #b3)

I would guess there are not enough spaces after that 'b2=",#b2 to clear all the text on the display -

Code:
192      201
|        |
234567890123456
b2=_xx__ b3=_xx
As to the bizarre values; byte variables can only hold values 0 to 255. Try to store a larger value and it will be truncated to the least 8-bits.
 
Top