# Sending text to lcd display via i2c

**URL:** <https://discourse.nodered.org/t/sending-text-to-lcd-display-via-i2c/13377>\
**Category:** General\
**Created:** [16 July 2019 19:17 UTC](https://discourse.nodered.org/t/sending-text-to-lcd-display-via-i2c/13377 "2019-07-16T19:17:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hunterhb](https://avatars.discourse-cdn.com/v4/letter/h/a3d4f5/32.png) [@hunterhb](https://discourse.nodered.org/u/hunterhb)\
**Post date:** [16 July 2019 19:17 UTC](https://discourse.nodered.org/t/sending-text-to-lcd-display-via-i2c/13377/1 "2019-07-16T19:17:08Z")

</div>

Hello,  
I'm trying to send text to an lcd display.  
I installed the driver for the i2c bus manually.  
The system recognizes the LCD display with 0x27.  
I also installed the node-red-contrib-i2c V0.5.2.  
The Scan node even can see the Display 39 decimal.  
But how can I send a Text in 2 Lines to the display?

Thank you for your support

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [16 July 2019 22:27 UTC](https://discourse.nodered.org/t/sending-text-to-lcd-display-via-i2c/13377/2 "2019-07-16T22:27:17Z")

</div>

What platform are you using?  
What version of NR and node.js?  
what does your existing flow look like?  
what node are you using to access the display?  
have you searched thru the `flows` tab on this site?

---

<div class="post-metadata">

**Author:** ![hunterhb](https://avatars.discourse-cdn.com/v4/letter/h/a3d4f5/32.png) [@hunterhb](https://discourse.nodered.org/u/hunterhb)\
**Post date:** [17 July 2019 06:24 UTC](https://discourse.nodered.org/t/sending-text-to-lcd-display-via-i2c/13377/3 "2019-07-17T06:24:05Z")

</div>

Hallo zenofmud,

I'm using a raspberry pi 3b+ computer to realize a pool control unit.  
The version of the installed node red 0.20.5.  
node.js V8.11.1.  
I want to show all 10 seconds another temperature.  
To do this I have a first line that describes the kind of temperature and a second line with the value of the temperature.  
I tried to solve that problem with this flow:

```auto
[{"id":"83fd99bb.77784","type":"i2c_LCD_Output","z":"b63bfe40.86e8f8","name":"LCD-Ansteuerung","manufacturer":"Sainsmart","Line1":"Line1","Line2":"Line2","settings":"Basic","basic_screen_color":"ON","timeLimit":3,"timeLimitType":"minutes","i2c_device_number":1,"i2c_address":"0x27","advanced_clear":"clear","advanced_close":"close","advanced_color":"color","advanced_char0":"char0","advanced_char1":"char1","advanced_char2":"char2","advanced_char3":"char3","advanced_char4":"char4","advanced_char5":"char5","advanced_char6":"char6","advanced_char7":"char7","x":730,"y":140,"wires":[]},{"id":"859aa464.dad6d","type":"inject","z":"b63bfe40.86e8f8","name":"Every_10_Seconds","topic":"","payload":"","payloadType":"date","repeat":"10","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":140,"wires":[["3d7200d6.b7ef3","59fa5d98.9efdc4"]]},{"id":"3d7200d6.b7ef3","type":"function","z":"b63bfe40.86e8f8","name":"LCD-Anzeige-Umschalten","func":"var aktuell = global.get('AnzeigeTemp');\nif (aktuell == 'T1')\n{\n msg.Line1 = 'T1 Pooltemperatur:'\n msg.Line2 = global.get('T1') + ' °C';\n}\nif (aktuell == 'T2')\n{\n msg.Line1 = 'T2 Rücklauf Pool:';\n msg.Line2 = global.get('T2') + ' °C';\n}\nif (aktuell == 'T3')\n{\n msg.Line1 = 'T3 Solarabsorber:';\n msg.Line2 = global.get('T3') + ' °C';\n}\nif (aktuell == 'T4')\n{\n msg.Line1 = 'T4 Außentemperatur:';\n msg.Line2 = global.get('T4') + ' °C';\n}\n//aktuell auf den neuen Stand bringen\nif (aktuell == 'T1')\n{\n global.set('AnzeigeTemp','T2');\n}\nif (aktuell == 'T2')\n{\n global.set('AnzeigeTemp','T3');\n}\nif (aktuell == 'T3')\n{\n global.set('AnzeigeTemp','T4');\n}\nif (aktuell == 'T4')\n{\n global.set('AnzeigeTemp','T1');\n}\nreturn msg;","outputs":1,"noerr":0,"x":440,"y":140,"wires":[[]]},{"id":"822c44d8.cb2768","type":"debug","z":"b63bfe40.86e8f8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":690,"y":240,"wires":[]},{"id":"59fa5d98.9efdc4","type":"i2c scan","z":"b63bfe40.86e8f8","x":400,"y":240,"wires":[["822c44d8.cb2768"],[]]}]

```

[{"id":"83fd99bb.77784","type":"i2c\_LCD\_Output","z":"b63bfe40.86e8f8","name":"LCD-Ansteuerung","manufacturer":"Sainsmart","Line1":"Line1","Line2":"Line2","settings":"Basic","basic\_screen\_color":"ON","timeLimit":3,"timeLimitType":"minutes","i2c\_device\_number":1,"i2c\_address":"0x27","advanced\_clear":"clear","advanced\_close":"close","advanced\_color":"color","advanced\_char0":"char0","advanced\_char1":"char1","advanced\_char2":"char2","advanced\_char3":"char3","advanced\_char4":"char4","advanced\_char5":"char5","advanced\_char6":"char6","advanced\_char7":"char7","x":730,"y":140,"wires":},{"id":"859aa464.dad6d","type":"inject","z":"b63bfe40.86e8f8","name":"Every\_10\_Seconds","topic":"","payload":"","payloadType":"date","repeat":"10","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":140,"wires":[["3d7200d6.b7ef3","59fa5d98.9efdc4"]]},{"id":"3d7200d6.b7ef3","type":"function","z":"b63bfe40.86e8f8","name":"LCD-Anzeige-Umschalten","func":"var aktuell = global.get('AnzeigeTemp');\nif (aktuell == 'T1')\n{\n msg.Line1 = 'T1 Pooltemperatur:'\n msg.Line2 = global.get('T1') + ' °C';\n}\nif (aktuell == 'T2')\n{\n msg.Line1 = 'T2 Rücklauf Pool:';\n msg.Line2 = global.get('T2') + ' °C';\n}\nif (aktuell == 'T3')\n{\n msg.Line1 = 'T3 Solarabsorber:';\n msg.Line2 = global.get('T3') + ' °C';\n}\nif (aktuell == 'T4')\n{\n msg.Line1 = 'T4 Außentemperatur:';\n msg.Line2 = global.get('T4') + ' °C';\n}\n//aktuell auf den neuen Stand bringen\nif (aktuell == 'T1')\n{\n global.set('AnzeigeTemp','T2');\n}\nif (aktuell == 'T2')\n{\n global.set('AnzeigeTemp','T3');\n}\nif (aktuell == 'T3')\n{\n global.set('AnzeigeTemp','T4');\n}\nif (aktuell == 'T4')\n{\n global.set('AnzeigeTemp','T1');\n}\nreturn msg;","outputs":1,"noerr":0,"x":440,"y":140,"wires":[]},{"id":"822c44d8.cb2768","type":"debug","z":"b63bfe40.86e8f8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":690,"y":240,"wires":},{"id":"59fa5d98.9efdc4","type":"i2c scan","z":"b63bfe40.86e8f8","x":400,"y":240,"wires":[["822c44d8.cb2768"],]}]

To do this I'm using this node node-red-contrib-i2c-lcd-adafruit-sainsmart V0.7.30.  
But I aways get an error:

> Blockquote  
> TypeError: "callback" argument must be a function

I also tried this link:  
[https://infusionsystems.com/pishield/sending-data-to-1602-lcd-with-node-red/](https://infusionsystems.com/pishield/sending-data-to-1602-lcd-with-node-red/)

But i failed, because I can't install the needed node.

I would be very thankfull for help.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [17 July 2019 08:35 UTC](https://discourse.nodered.org/t/sending-text-to-lcd-display-via-i2c/13377/4 "2019-07-17T08:35:37Z")

</div>

Both those nodes state on their GitHub pages that they don't work with Node 10 but I wonder if a version of Node 8.x caused the problem.

For node-red-contrib-i2c-lcd-adafruit-sainsmart there is this comment so there may be hope for you using this node:

### **[meeki007](https://github.com/meeki007)** commented [28 days ago](https://github.com/meeki007/node-red-contrib-i2c-lcd-adafruit-sainsmart#issuecomment-503373389)

Making headway -- still a month out. only have 2-4hrs every weeked to peck at this ☹ updated main readme page to reflect the break.
