Python Forum

Full Version: Write to a LCD display using i2c to a Raspberry Pi using i2c 6398 4x20 LCD
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have been unable to find out how to write normal ascii data to a LCD display using i2c.
One of the code snippets I have tried is:
Bus=smbus,SMBus(1)
Bus.write_byte_data(addr,register,value)
and
Bus.write_block_data(addr,register,value1,value2,value3)
How do I write ascii data to the LCD display
The value variables are integers and I want to write ascii data such as "Time=02:34:45"
I am trying to write strings of data to the LCD display and cannot fine any help to do this.
Any responses will be most appreciated.
the 6398 is a typo which should not be there
I wouldn't expect most character LCDs to speak i2c. Do you have one from Adafruit or similar? They have a library for their i2c backpack that you might be able to use. Have you tried that?
(Apr-28-2022, 03:10 AM)bowlofred Wrote: [ -> ]I wouldn't expect most character LCDs to speak i2c. Do you have one from Adafruit or similar? They have a library for their i2c backpack that you might be able to use. Have you tried that?
my LCD is from sparkfun and I also have one from New Haven.

I don't understand why I can't find an example of writing ascii characters on an i2c bus to a character LCD display.
I will take a look at the adafruit i2c backpack library, thanks.