Newbie to ZBasic - BPI-216 Backpack LCD, how to send control
Posted: 09 April 2009, 14:42 PM
this seems like a very stupid query, but it may be so simple i cant figure it out. Embarrassing to have to ask this...
using ZBasic i have a BPI-216L http://www.seetron.com/slcds.htm backpack LCD display tied to COM1 -
i can write to it with Console.Write(line) and Debug.Print commands just fine (after reconfiguring the port for 9600 baud) but i cant get the ascii commands out to it.
But i need to send commands to it that set the cursor position and reset/clear the display etc.
The display recognizes a command by preceeding the command with an ASCII 254 sent to it followed by the command (in the range of 128-253 decimal).
when i send Console.Write 254 & 1 (which is supposed to be a reset/clear screen command, it appears that an implied conversion occurs that appears on the serial port out as three characters representing "254", which of course the LCD sees as just ascii 2 followed by ascii 5 followed by ascii 4 then an ascii "1". Four bytes on the serial port.
similary to move the cursor to the first line column 1, the sequence is
console.write 254 & 128.... but what is emitted on the serial port is "254128"
i have tried all kinds of variants/conversions/byte arrays print statemenets etc... always wants to convert my hex FE/dec 254 to "254" on the output.
what is the obvious magic syntax cookie that i am missing that will allow me to take control of the LCD so that i can sent it a value over 127 decimal?
feel like an idiot asking this, but i guess thats what this forum is for...
regards,
-bob
using ZBasic i have a BPI-216L http://www.seetron.com/slcds.htm backpack LCD display tied to COM1 -
i can write to it with Console.Write(line) and Debug.Print commands just fine (after reconfiguring the port for 9600 baud) but i cant get the ascii commands out to it.
But i need to send commands to it that set the cursor position and reset/clear the display etc.
The display recognizes a command by preceeding the command with an ASCII 254 sent to it followed by the command (in the range of 128-253 decimal).
when i send Console.Write 254 & 1 (which is supposed to be a reset/clear screen command, it appears that an implied conversion occurs that appears on the serial port out as three characters representing "254", which of course the LCD sees as just ascii 2 followed by ascii 5 followed by ascii 4 then an ascii "1". Four bytes on the serial port.
similary to move the cursor to the first line column 1, the sequence is
console.write 254 & 128.... but what is emitted on the serial port is "254128"
i have tried all kinds of variants/conversions/byte arrays print statemenets etc... always wants to convert my hex FE/dec 254 to "254" on the output.
what is the obvious magic syntax cookie that i am missing that will allow me to take control of the LCD so that i can sent it a value over 127 decimal?
feel like an idiot asking this, but i guess thats what this forum is for...
regards,
-bob