afiskon / stm32-ssd1306

STM32 library for working with OLEDs based on SSD1306, SH1106, SH1107 and SSD1309, supports I2C and SPI
https://eax.me/stm32-ssd1306/
MIT License
740 stars 206 forks source link

How to Add Degree Celsius Symbol °C #87

Closed asking23 closed 5 months ago

asking23 commented 5 months ago

How to Add Degree Celsius Symbol ? not getting any clue. need to add Degree Celcius.°C

afiskon commented 5 months ago

Please read README.

kossnikita commented 5 months ago

Small hint from me. You can use generate.py with --charset argument to introduce your own charset to generated font.

For example

charset.txt

 !"°C%&'()*+,-./0123456789:;<=>?

And run

./generate.py -f arial.ttf -s 18 --charset charset.txt

It replaces # with ° and $ with C.

atlas

Then just use this in code

sprintf(buf, "%u#$", temperature); // #$ means °C
asking23 commented 5 months ago

Thanks aton..!!