Skip to content

Instantly share code, notes, and snippets.

@atsage

atsage/README.md Secret

Created November 9, 2018 17:23
Show Gist options
  • Save atsage/611699c1c6e6b90f6100b0ab2574fc0d to your computer and use it in GitHub Desktop.
Save atsage/611699c1c6e6b90f6100b0ab2574fc0d to your computer and use it in GitHub Desktop.
node-red-contrib-lcd20x4-i2c Example

Example of how to use node-red-contrib-lcd20x4-i2c

[
{
"id": "5c7a63fc.d041e4",
"type": "LCD20x4-I2C",
"z": "514d8500.298c34",
"name": "LCD2004",
"speed": "3",
"size": "20x4",
"x": 520,
"y": 160,
"wires": []
},
{
"id": "924c4048.97a328",
"type": "function",
"z": "514d8500.298c34",
"name": "Message",
"func": "// Line Number Msg String Start Position Centered\n// 1 Date/Time Ignored true\n// 2 \"Test line 2.\" 2 false\n// 3 \"Test line 3.\" 3 false\n// 4 \"Test line 4.\" 4 false\n\n//var sString01 = \"Test line 1.\";\nvar sString01 = msg.payload;\nvar sString02 = \"Test line 2.\";\nvar sString03 = \"Test line 3.\";\nvar sString04 = \"Test line 4.\";\nvar iPos01 = 1;\nvar iPos02 = 2;\nvar iPos03 = 3;\nvar iPos04 = 4;\nvar bCenter01 = true;\nvar bCenter02 = false;\nvar bCenter03 = false;\nvar bCenter04 = false;\n\nmsg.payload = {\n\tmsgs:[\n\t\t{\n\t\t\tmsg:sString01,\n\t\t\tpos:iPos01,\n\t\t\tcenter:bCenter01\n\t\t},\n\t\t{\n\t\t\tmsg:sString02,\n\t\t\tpos:iPos02,\n\t\t\tcenter:bCenter02\n\t\t},\n\t\t{\n\t\t\tmsg:sString03,\n\t\t\tpos:iPos03,\n\t\t\tcenter:bCenter03\n\t\t},\n\t\t{\n\t\t\tmsg:sString04,\n\t\t\tpos:iPos04,\n\t\t\tcenter:bCenter04\n\t\t}\n\t]\n};\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 320,
"y": 160,
"wires": [
[
"5c7a63fc.d041e4",
"33adbf23.498828"
]
]
},
{
"id": "33adbf23.498828",
"type": "debug",
"z": "514d8500.298c34",
"name": "",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": true,
"complete": "payload",
"x": 540,
"y": 220,
"wires": []
},
{
"id": "f4f137d8.befd8",
"type": "inject",
"z": "514d8500.298c34",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "1",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 110,
"y": 100,
"wires": [
[
"dc6e3ed6.f4191"
]
]
},
{
"id": "dc6e3ed6.f4191",
"type": "moment",
"z": "514d8500.298c34",
"name": "",
"topic": "",
"input": "payload",
"inputType": "msg",
"inTz": "America/New_York",
"adjAmount": 0,
"adjType": "days",
"adjDir": "add",
"format": "ddd DD-MM HH:mm:ss",
"locale": "en_US",
"output": "payload",
"outputType": "msg",
"outTz": "America/New_York",
"x": 140,
"y": 160,
"wires": [
[
"924c4048.97a328"
]
]
},
{
"id": "b113533e.df98a8",
"type": "comment",
"z": "514d8500.298c34",
"name": "Dependencies for Raspberry Pi & Node-Red",
"info": "******************************************\n* First, Thanks for the LCD20x4-I2C node *\n* stubby-phillips *\n* This is what worked for me. *\n* RPi = 2b *\n* OS = raspbian-stretch-lite.4.14.50-v7 *\n* Windows Manager = lxde *\n* Node-Red = v.0.19.4 *\n******************************************\n* Notes to self:\n* Install python smbus library.\n* At console run 'sudo apt update'\n* At console run 'sudo apt-get install python-smbus'\n* Install python-pip (If 'Manage palette' option missing from Node-Red settings menu)\n* At console run 'sudo apt-get install python-pip'\n* Reboot RPi..\n* \n* Add LCD20x4-I2C node to Node-Red.\n* node-red-contrib-lcd20x4-i2c\n* https://flows.nodered.org/node/node-red-contrib-lcd20x4-i2c\n* https://www.npmjs.com/package/node-red-contrib-lcd20x4-i2c\n* https://github.com/atsage/node-red-contrib-LCD20x4-I2C\n* In Node-Red...\n* Select User settings\n* https://www.coursera.org/lecture/developer-nodered/mastering-the-node-red-menu-options-165iX\n* Select Manage palette\n* Select Install tab\n* Search moduals for 'node-red-contrib-lcd20x4-i2c'\n* Select Install button\n* Select Install button\n*\n* Add node-red-contrib-moment node to Node-Red (Needed for this example only)\n* Same as above but search for 'node-red-contrib-moment'\n* \n* Return to Node-Red example flow and select 'Deploy'\n*\n* Should show Day, Month/day,Date on line 1\n* Make sure you check pot on back of unit for correct contrast!\n* Wasted about 2 hours on this.\n*",
"x": 190,
"y": 40,
"wires": []
}
]
@Gun-neR
Copy link

Gun-neR commented Jul 1, 2021

Unfortunately I have been unable to get any results (just blank) on my 2004 LCD display with current version of Node Red v.1.3.5
https://discourse.nodered.org/t/trying-to-send-text-to-lcd-over-i2c-contrib/47873

Display works fine with Python scripts directly on RPi)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment