Debugging Help
Chucky
Posts: 4
Does anyone know why this code refuses to output "14" to my attached LCD?· All the connections are correct, as I can output data in string form to the LCD.
' {$STAMP BS2p}
' {$PBASIC 2.5}
TX············· PIN 0
T19K2·········· CON 110
LcdBaud········ CON T19K2
LcdCls········· CON···· $0C············
LcdBLoff······· CON···· $12············
LcdOn1········· CON···· $16············
NB1········· VAR Byte
NB1 = 14
LCDSet:
HIGH TX
PAUSE 250
Main:
SEROUT TX, T19K2, [noparse][[/noparse]LcdBLoff, LcdOn1, LcdCls]
PAUSE 450
SEROUT TX, T19K2, [noparse][[/noparse]NB1]
DEBUG DEC NB1
END
....as I mentioned, if I replace the [noparse][[/noparse]NB1] with [noparse][[/noparse]"14"], the LCD shows 14.· I really can't tell what's wrong because the debugger says that NB1 has a value of 14 when I run the program.
Thanks,
Q
' {$STAMP BS2p}
' {$PBASIC 2.5}
TX············· PIN 0
T19K2·········· CON 110
LcdBaud········ CON T19K2
LcdCls········· CON···· $0C············
LcdBLoff······· CON···· $12············
LcdOn1········· CON···· $16············
NB1········· VAR Byte
NB1 = 14
LCDSet:
HIGH TX
PAUSE 250
Main:
SEROUT TX, T19K2, [noparse][[/noparse]LcdBLoff, LcdOn1, LcdCls]
PAUSE 450
SEROUT TX, T19K2, [noparse][[/noparse]NB1]
DEBUG DEC NB1
END
....as I mentioned, if I replace the [noparse][[/noparse]NB1] with [noparse][[/noparse]"14"], the LCD shows 14.· I really can't tell what's wrong because the debugger says that NB1 has a value of 14 when I run the program.
Thanks,
Q
Comments
SEROUT TX, T19K2, [noparse][[/noparse]LcdBLoff, LcdOn1, LcdCls]
PAUSE 450
SEROUT TX, T19K2, [noparse][[/noparse]DEC NB1]
·
DEBUG DEC NB1
END
You need to use the DEC modifier with your SEROUT to the LCD just like you did with your DEBUG.