Issue
I have a waveshare black and white display hooked up to a raspberry pi. The thing works wonderfully, except it won't show some special characters. I can print the degree symbol (using \N{DEGREE SIGN}) without issue, but no method of printing any superscript (like ²), or even the percent sign (%) work. All that's printed is an empty space. What am I missing?
Solution
The waveshare LCD is not a bitmap device: it has it's own onboard controller and a limited font-table, like the ubiquitous HD44780 (the 'standard' alphanumeric display of hobby projects*, normally matched with a 16x2 lcd: I'm sure you know the kind I mean).
See the datasheet p. 14 for the font table.
The font in that datasheet does have a %, encoded at 0b00100101
. I'm not sure why it isn't displaying since:
>>> ord("%") == 0b00100101
True
You will need to do some digging, and have a look (probably) at how the python driver is implemented. It shouldn't be too hard to find out what byte is actually being sent. As a starting point, check you are using the default font.
Note that with an 8-bit font table you are never going to have full unicode coverage, but you can normally program a few 'custom' chars with these devices, which is often enough to get what you need. When you have problems with these devices, start by comparing the font table (make sure it's the correct font table for your device, as different tables often ship for different countries) with the actual byte you are sending (via ord()
or an ascii font table. Frequently you only get decent overlap for the alphanumerics and a few others like .
. If the driver doesn't do it for you, you may need to implement translation for characters which are encoded in a different place.
*I've got a fair few around the house at the moment ;)
References
https://www.waveshare.com/datasheet/LCD_en_PDF/LCD1602.pdf
Answered By - 2e0byo Answer Checked By - Terry (WPSolving Volunteer)