adafruit / Adafruit_CircuitPython_CharLCD

Library code for character LCD interfacing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could not display degree sign properly

daqingli616 opened this issue · comments

I tried to use your driver to display a string with degree sign in it. The string I tried to display is

uString = 'Temp: 30' + u'\N{DEGREE SIGN}' + 'C'
print (uString) shows: Temp: 30°C
However, the following code only shows: Temp: 30-C
lcd.message = uString

It is run on a Raspberry PI4 with latest Raspbian and python 3.7.3.

there are two ways for degree sign

  1. use default character in its RAM, actually it is 0xDF, see https://mil.ufl.edu/3744/docs/lcdmanual/characterset.html, it may differ for different LCD, check its datasheet
  2. create customized characters, code like https://github.com/adafruit/Adafruit_CircuitPython_CharLCD/blob/main/examples/charlcd_customcharacter.py