rwblinn Posted August 2, 2016 at 06:34 AM Share Posted August 2, 2016 at 06:34 AM Hi, seeking for an example how to define and write a special character to the LCD20x4 bricklet, f.e. arrow up, using the brick-mqtt-proxy? If possible, also how to do the same via javaScript. Appreciated Quote Link to comment Share on other sites More sharing options...
Nic Posted August 2, 2016 at 11:39 AM Share Posted August 2, 2016 at 11:39 AM With Javascript like described here: http://www.tinkerforge.com/en/doc/Software/Bricklets/LCD20x4_Bricklet_JavaScript.html#BrickletLCD20x4.setCustomCharacter Or y can set it directly in Brick Viewer version >= 2.0.1 http://www.tinkerforge.com/de/doc/_images/bricklet_lcd_20x4_brickv.jpg I assume for the mom the Mqtt proxy doesnt support it: http://www.tinkerforge.com/en/doc/Software/Brick_MQTT_Proxy.html#supported-device-topics Quote Link to comment Share on other sites More sharing options...
rwblinn Posted August 2, 2016 at 02:27 PM Author Share Posted August 2, 2016 at 02:27 PM Thanks for reply. For MQTT 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): GETTER_SPECS = [ ... ] SETTER_SPECS = [ ... (set_custom_character', 'custom_character/set', ['index', 'character']), ... ] Quote Link to comment Share on other sites More sharing options...
photron Posted August 3, 2016 at 07:55 AM Share Posted August 3, 2016 at 07:55 AM 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. Quote Link to comment Share on other sites More sharing options...
rwblinn Posted August 3, 2016 at 11:44 AM Author Share Posted August 3, 2016 at 11:44 AM 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: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.