rwblinn Geschrieben August 2, 2016 at 06:34 Geschrieben August 2, 2016 at 06:34 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 Zitieren
Nic Geschrieben August 2, 2016 at 11:39 Geschrieben August 2, 2016 at 11:39 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 Zitieren
rwblinn Geschrieben August 2, 2016 at 14:27 Autor Geschrieben August 2, 2016 at 14:27 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']), ... ] Zitieren
photron Geschrieben August 3, 2016 at 07:55 Geschrieben August 3, 2016 at 07:55 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. Zitieren
rwblinn Geschrieben August 3, 2016 at 11:44 Autor Geschrieben August 3, 2016 at 11:44 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: Zitieren
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.