I2C LCD Almost working in NR

I have a Waveshare 1602 I2C Display connected to a RPI Zero 2W via the I2C pins. Running an example python script the LCD shows two lines of text on the display. So the hardware works fine.

As a test I have Node Red and "node-red-contrib-i2c" installed on the RPI Zero 2W. Within NR I would like to initialize the LCD, set the cursor to the 4th position and write the letter "A" to the display.

In the next link you can download the NR flow: https://we.tl/t-RzAPmVm21F

In NR the initializing cycle works fine, the cursor goes to the 4th position on the first line. But writing the "A" to the display doesn't seem to work. My guess is that the "RS" bit is not correctly received by the LCD. Everything in the INIT CYCLE, so everything in green in the spreadsheet overview is correctly received by the LCD. Writing the "A" to the DDRAM however ( marked in red ) doesn't work. The "I2C" node is set up to send 2 bytes. All the commands in green are within the range of 1 byte. And the Write "A" command is in two bytes, so I assume this is the issue. So my question is, how do I make sure that the "RS" and "R/W" bit are correctly addressed by using the "node-red-contrib-i2c" node in NR?

Other useful links for this issue:
https://flows.nodered.org/node/node-red-contrib-i2c
https://www.waveshare.com/wiki/LCD1602_I2C_Module
https://files.waveshare.com/upload/4/4d/LCD1602_I2C_Module.pdf

So the reason the Display didn't work is because the previous command table I've made was wrong. It's poorly documented but the RS and R/W are the two MSB instead of the two LSB. So with this table you can send text to the LCD via the I2C node.

At the moment there is not an easy way to send text to the I2C display via Node Red. An alternative way is to connect the I2C display to an ESP. You then connect the ESP to your network and send MQTT messages to fill out the display.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.