°C shows as |# and not as °C ?

I'm using a DS18B20 Temperature Sensor + Nano + 0.96"OLED Display. It's to display water temperature in a marine Seahorse Aquarium.

It actually works perpectly but the ° (°C) prints some odd graphics.

The line in the sktch is:

tempString += "°C";

But when the sketch runs, the ° sign shows as a vertical line and 20 dots in a rectangle. For now I've deleted the ° and the OLED just displays like: 25.24 C

Any ideas what I can do to get it to show correctly.

Many thanks

Steve/G4MJW



Not sure if the puctures uploaded?

You need to look at the spec for the display, and see what characters it recognizes, and can render. I'd guess it only understands basic ASCII, and a perhaps proprietary block graphic character set, and the degree symbol is simply not included, hence cannot be rendered.

Print the temperature without trying to append the "degree C"

What you're likely seeing is the bytes in the Unicode representation of the degree symbol (°). And the library doesn't know about Unicode.

Had you shown your complete sketch, I would have known what library you were using, been able to see what (if any) calls you'd made to adjust the character set, and been able to tell you what character to print to get the degrees symbol.

Thank you for all yr replies.

The design and sketch are from the Arduino get started website:

The OLED Display used is as used in the article. I have about 20 of them. They all have an address of 0x3C and use adafruitGFX library. I'm positive I've used ° before when I made weather station using a number of these displays.

However, there are other libraries which work with the SSD1306, which I might give a try.

Thank you

Steve/G4MJW

maybe..

// tempString += " °C";
  tempString += "\xF8\C";

good luck.. ~q

Since oled.cp437(true); wasn't invoked, it might be tempString += "\xF7""C";

. . . Perfect. "\xF8""C";` gave me a little square (maybe 9 dots but no hole in the middle. But: "\xF7""C"; gives me a perfect degrees sign.

Thanks for your help. Next is a PH display!

Bye for now

Steve/G4MJW

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.