Shop OBEX P1 Docs P2 Docs Learn Events
Debugging Help — Parallax Forums

Debugging Help

ChuckyChucky Posts: 4
edited 2007-05-28 22:03 in BASIC Stamp
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

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-05-28 22:03
    Main:
    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.
Sign In or Register to comment.