rwblinn Geschrieben October 21, 2015 at 13:00 Geschrieben October 21, 2015 at 13:00 Hi, the Brick MQTT Proxy is a great extension - simplified a lot. Question: How to display special chars on the LCD20x4? Looking at the example below, how to display f.e. the special char ° which is HHHHHHHL according the special char table. Example Publish Command: mosquitto_pub -t tinkerforge/bricklet/lcd_20x4/rTS/write_line/set -m '{"line":0, "position":5, "text":"25 °C"}' Zitieren
photron Geschrieben October 21, 2015 at 16:45 Geschrieben October 21, 2015 at 16:45 Actually the degree sign in 0b11011111 == 0xDF. So you need to pass 0xDF for the degree sign. You can do this with a Unicode escape sequence: \u00DF mosquitto_pub -t tinkerforge/bricklet/lcd_20x4/rTS/write_line/set -m '{"line":0, "position":5, "text":"25 \u00DFC"}' Zitieren
rwblinn Geschrieben October 22, 2015 at 07:34 Autor Geschrieben October 22, 2015 at 07:34 Thanks a lot - works fine. Further Question: Where to find the list of special chars and unicode to use (like the example you gave)? Looking for Arror Up and Arrow Down to show trend on the LCD20x4 Bricklet display. Again: The MQTT Proxy is fantastic. Zitieren
photron Geschrieben October 22, 2015 at 08:06 Geschrieben October 22, 2015 at 08:06 You already looked in the right place: https://github.com/Tinkerforge/lcd-20x4-bricklet/raw/master/datasheets/standard_charset.pdf You need to take the 4 bit column and row number (H = 1, L = 0) of the character you want and interpret it as binary like this: 0b<column><row> Convert that to hex and prepend "\u00". You said "°" would be "HHHHHHHL". You where off by one column and had column and row mixed up. Actually "°" is in column HHLH and row HHHH. This translates to 0b11011111, that is 0xDF in hex. Prepended with \u00 you get \u00DF. Zitieren
rwblinn Geschrieben October 22, 2015 at 08:38 Autor Geschrieben October 22, 2015 at 08:38 Thanks a lot for this very good explaination. You might consider to include this in your documentation of the LCD displays. Zitieren
rwblinn Geschrieben October 22, 2015 at 13:13 Autor Geschrieben October 22, 2015 at 13:13 One more related question is how to write a custom char. The standard table does not contain arrow up. Question is how to translate the custom arrow up from bytes to the hex value to be displayed as asked previous. * ``character[0] = 0b00000000`` (decimal value 0) * ``character[1] = 0b00000100`` (decimal value 4) * ``character[2] = 0b00001010`` (decimal value 10) * ``character[3] = 0b00011011`` (decimal value 27) * ``character[4] = 0b00000100`` (decimal value 4) * ``character[5] = 0b00000100`` (decimal value 4) * ``character[6] = 0b00001110`` (decimal value 14) * ``character[7] = 0b00000000`` (decimal value 0) Appreciate your help Zitieren
photron Geschrieben October 22, 2015 at 13:28 Geschrieben October 22, 2015 at 13:28 Set custom character 0: mosquitto_pub -t tinkerforge/bricklet/lcd_20x4/SCD32/custom_character/set -m '{"index":0, "character":[0,4,10,27,4,4,14,0]}' Write it: mosquitto_pub -t tinkerforge/bricklet/lcd_20x4/SCD32/write_line/set -m '{"line":0, "position":0, "text":"Up: \u0008"}' Custom character 0-7 map to \u0008-\u00015 \u0008-\u000F. (Edit: \u takes hex numbers) Zitieren
rwblinn Geschrieben October 23, 2015 at 13:20 Autor Geschrieben October 23, 2015 at 13:20 Works with correction: Char range is from \u0008 to \u000F BTW: Have written (in B4J) a small utility http://www.rwblinn.de/iot/tflcdcharmaker.htm helping to define Custom Chars for the LCD Bricklet. 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.