alfkoehn / CO2_monitor

An open-source CO2 monitor helping to ensure a healthy environment in a class room and slowing down the spread of the corona SARS-CoV-2 virus.
https://github.com/alfkoehn/CO2_monitor
43 stars 8 forks source link

SSD1306 - wrong character for "Degree" (167 instead of 248) #2

Closed ber-red closed 3 years ago

ber-red commented 3 years ago

Aim: show the Degree sign in "°C" Code: In the .ino you reference to Codepage 437, character 167 (which is "Masculine ordinal indicator") I found detail here: codepage437 and changed the section in .ino to

...
display.setCursor(x0+7*6,15);
display.write(248);
...

PS: additionally I prefixed display.write(248); with display.cp437(true); // Use full 256 char 'Code Page 437' font (worked either with or whitout it but feels better) ;-)

alfkoehn commented 3 years ago

Aim: show the Degree sign in "°C" Code: In the .ino you reference to Codepage 437, character 167 (which is "Masculine ordinal indicator") I found detail here: codepage437 and changed the section in .ino to

...
display.setCursor(x0+7*6,15);
display.write(248);
...

indeed, I was using the wrong character, thanks for taking your time to post an issue here, greatly appreciated :)

PS: additionally I prefixed display.write(248); with display.cp437(true); // Use full 256 char 'Code Page 437' font (worked either with or whitout it but feels better)

in my case, it was even necessary to do that, i.e. without enabling that font, the degree symbol is shown incorrectly.