Displaying variables on an LCD
Jim the Hermit
Posts: 79
I would like my LCD to display a variable. It's the 4x20 serial (#27979)
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
TX_PIN = 0
BAUD = 19_200
VAR
byte aa
OBJ
LCD : "FullDuplexSerial.spin"
PUB Main
aa := 99
LCD.start(TX_PIN, TX_PIN, %1000, 19_200)
waitcnt(clkfreq / 100 + cnt) ' Pause for FullDuplexSerial.spin to initialize
lcd.str(string(12)) ' clear screen
LCD.str(string("Hello, this text will wrap."))
lcd.str(string(13)) ' carriage return
lcd.str(string(aa))
The last line doesn't work, neither does "lcd.str(string aa)", "lcd.str(aa)", lcd.str aa"
Nor any other combination I could think of.
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
TX_PIN = 0
BAUD = 19_200
VAR
byte aa
OBJ
LCD : "FullDuplexSerial.spin"
PUB Main
aa := 99
LCD.start(TX_PIN, TX_PIN, %1000, 19_200)
waitcnt(clkfreq / 100 + cnt) ' Pause for FullDuplexSerial.spin to initialize
lcd.str(string(12)) ' clear screen
LCD.str(string("Hello, this text will wrap."))
lcd.str(string(13)) ' carriage return
lcd.str(string(aa))
The last line doesn't work, neither does "lcd.str(string aa)", "lcd.str(aa)", lcd.str aa"
Nor any other combination I could think of.
Comments
With almost all of the Spin objects, whether in the Object Exchange or included with the Propeller Tool, each public method has a comment that describes what the method does, what parameters it requires, and what result, if any, it returns. Please look at the source code for the objects you use, particularly the comments.