Jump to content

Brick MQTT Proxy - LCD20x4 Display Special Chars?


rwblinn

Recommended Posts

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"}'

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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)

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.

Guest
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...