Using 4x20 LCD for first time
JBWolf
Posts: 405
Hello!
I just received the 4x20 LCD model #27979 from the parallax store and am trying to get familiar with it.
I am using the 'fullduplexserial.spin' from the example code, but having trouble placing characters where i would like to.
Here is an example of where I am having trouble. In the code below, I would like variable x to be placed at the end of the "test #:" string. But it does not clear the previous variable output before writing the next.
So my output look like this "Test #: 12345678910Complete" rather than only displaying one decimal at a time, then displaying "Complete" on a new line.
I looked through the fullduplexserial spin code and could not find a subroutine for clearing or for position.
How can I clear the screen? Can I choose coordinates for character placement?
I just received the 4x20 LCD model #27979 from the parallax store and am trying to get familiar with it.
I am using the 'fullduplexserial.spin' from the example code, but having trouble placing characters where i would like to.
Here is an example of where I am having trouble. In the code below, I would like variable x to be placed at the end of the "test #:" string. But it does not clear the previous variable output before writing the next.
So my output look like this "Test #: 12345678910Complete" rather than only displaying one decimal at a time, then displaying "Complete" on a new line.
I looked through the fullduplexserial spin code and could not find a subroutine for clearing or for position.
How can I clear the screen? Can I choose coordinates for character placement?
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 TX_PIN = 0 BAUD = 19_200 OBJ LCD : "FullDuplexSerial.spin" var word x PUB Main LCD.start(TX_PIN, TX_PIN, %1000, 19_200) waitcnt(clkfreq / 100 + cnt) LCD.str(string("Test #:")) repeat while x < 10 x := x + 1 LCD.dec(x) waitcnt(clkfreq * 1 + cnt) LCD.str(string("Complete"))
Comments
Whenever I try to send a DEC value, it just prints it on the screen.
How do I properly send these DEC codes?
I was trying this, which is obviously wrong:
I sincerely appreciate any help
So what it does when you send 10
it transforms the number 10 into asci-code 49 and asci-code 48
lcd.tx(49) lcd.tx(49)
For sending control-commands use the method tx
lcd.tx(10) will send just asci-code "10"
keep the questions coming
best regards
Stefan
That helped alot, I made a test program while learning.
Rolls through 5 sessions of counting to 10.. turns backlight on and plays with some of the positioning functions.
I guess the only thing I cannot figure out is exactly what DEC modes 23 & 25 are for...
description is "turn the display on, with cursor off(25=on) and character blink"... I assumed this meant anything displayed after setting that mode, would cause the characters to blink.
What I'm seeing though is just the cursor blinking.
I can only get something to blink if I do so like in the "ShowRST" subroutine.