Degree symbol

I want to display the degree symbol, the minute and the seconds symbol on the SSD1306 from Adafruit. I'm making a GPS and i want these symbols for the coordinates. I don't know if i can and how to display them. Please help if you can. I'm using Arduino Duemilanove with the Ultimate GPS breakout from Adafruit. The SSD1306 is SPI.

Hi, for my compass degree for lcd i use:

lcd.begin(20, 4);
lcd.print(“Degrees:”);

In the void setup.

lcd.print((char)223);

In the void Loop which gives the degree symbol on lcd

Good luck

Is the coding same for the LCD and the SSD1306? What about the other two symbols? Thanks for replying!

On the PC: ° === -0176

you should check the char set of the LCD/screen if it is supported.
A small sketch could iterate over all possible chars

... LCD init here ...

void setup()
{
  for (int i=0; i< 255; i++)
  {
    lcd.goto(0,0);
    lcd.print(i);
    lcd.print(" ");
    lcd.write(i);
    delay(500);
  }
}
void (){}

If you look at this link:- https://www.adafruit.com/blog/2012/02/03/adafruit-ssd1306-monochrome-128x32-oled-graphic-display-running-at-over-500-hz-frame-rate/ It looks like the tenth character on the top row will do it.

You can always hack the library because the fonts are all software defined so you can change them to what ever you want.

Looking at the 1306 driver on GitHub…

includes a 5x7 character set (LCD_font_5x7.h) which defines the bitmap for each ASCII character. You’ll have to select an otherwise unused character and redefine this as a degree symbol.

e.g.

before…

	0x46, 0x28, 0x10, 0x08, 0x06, // y
	0x44, 0x64, 0x54, 0x4c, 0x44, // z
	0x00, 0x08, 0x77, 0x41, 0x00, // {
	0x00, 0x00, 0x7f, 0x00, 0x00, // |
	0x00, 0x41, 0x77, 0x08, 0x00, // }
	0x10, 0x08, 0x18, 0x10, 0x08  // ~

};
#endif

becomes…

	0x46, 0x28, 0x10, 0x08, 0x06, // y
	0x44, 0x64, 0x54, 0x4c, 0x44, // z
	0x00, 0x08, 0x77, 0x41, 0x00, // {
	0x00, 0x00, 0x7f, 0x00, 0x00, // |
	0x00, 0x41, 0x77, 0x08, 0x00, // }
	0x20, 0x50, 0x20, 0x00, 0x00  // ~   <-- redefine '~' to display a degree symbol

//    -#---    row = 2^6
//    #-#--    row = 2^5
//    -#---    row = 2^4
//    -----    row = 2^3
//    -----    row = 2^2
//    -----    row = 2^1
//    -----    row = 2^0
//    ^^^^^
//    ||||+--- 0+0+0+0+0+0+0 = 0 (0x00)
//    |||+---- 0+0+0+0+0+0+0 = 0 (0x00)
//    ||+----- 0+0+0+0+0+2^5+0 = 2^5 = (0x20)
//    |+------ 0+0+0+0+2^4+0+2^6 = 2^4+2^6 = (0x50)
//    +------- 0+0+0+0+0+2^5 = 2^5 = (0x20)
};
#endif

(I’m guessing the pixel sequencing in the character array from examining the ‘y’ character. I could be wrong :)… but the above should give you an idea.

Thanks robtillaart and Grumpy_Mike!! I'll try it and i'll update.

Thanks Doddy!

For a 0.96" I2C IIC 128X64 OLED Display Module, using the following libraries:

#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

and setup to:

display.begin(SSD1306_SWITCHCAPVCC, 0x3C);

the code:

display.print((char)247);display.print(“C”);

works a charm.