Jump to content

LCD20x4 define & write special character using MQTT


Recommended Posts

Thanks for reply.


Looked at source brick-mqtt-proxy.py and noticed work in progress (see code snippet). So will wait for an updated brick-mqtt-proxy.

Any timelines when special chars will be supported?


# FIXME: get_custom_character and get_default_text need special handling
class BrickletLCD20x4Proxy(DeviceProxy):
(set_custom_character', 'custom_character/set', ['index', 'character']),


Link to comment
Share on other sites

It's not work in progress. You can use it without the getter. The documentation for the setter is missing by accident. I'll fix that.


As the documentation for the set_custom_character function says, you need to provide the custom character shape as a bitmask. The documentation has an example for a capital H.


Here's setting the first custom character (index 0) to an arrow-up shape:


mosquitto_pub -t tinkerforge/bricklet/lcd_20x4/SCD32/custom_character/set -m '{"index":0, "character":[4,14,21,4,4,4,4,4]}'


Now to write this custom character (index 0) to the display you need to write a character with byte representation 8. This can be done with the Unicode escape sequence \u0008 in JSON:


mosquitto_pub -t tinkerforge/bricklet/lcd_20x4/SCD32/write_line/set -m '{"line":0, "position":0, "text":"\u0008"}'


I'll add to my TODO list to add a custom character example to the API bindings.

Link to comment
Share on other sites

Thanks a lot for the information and swift reply.

Have integrated this into a Node-RED Flow and its working fine.


For those interested in Node-RED, look up my website http://www.rwblinn.de > IoT > Node-RED > Category TinkerForge.

One of the Node-RED flows uses the Bricklets LCD20x4, Temperature, Humidity, Barometer. Here some screenshots:








Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...