Search code examples
avratmegatemperature

Displaying temperature symbol


I am trying to output degree centigrade symbol from atmega2560 from serial port. I looked up at ascii table. The ascii code it said was 167. When I tried it there was another symbol instead which I can't show here. After doing little bit of research, I tried 0167+248. It displayed '○' instead of '°'. Other posts said that Alt + 167 works but could not find ascii code for Alt. Any suggestions ?


Solution

  • I am trying to output degree centigrade symbol from atmega2560 from serial port. I looked up at ascii table. The ascii code it said was 167.

    The format of the extended ASCII table (symbols from 127 to 255) depends on the code page that is used.

    When I tried it there was another symbol instead which I can't show here.

    You should figure out on what code page you are currently working. Like ISO 8859-1 (Latin-1) for example.

    Other posts said that Alt + 167 works but could not find ASCII code for Alt.

    What they meant is to press the ALT key and enter 167 on the numpad. This prints the character on position 167 (decimal) from the current code page.

    Remember that the ASCII value that is send from the micro controller is just interpreted on the receiver side according on its code page.