I2C and Adafruit SSD1306 OLED

I recently bought a small 0.96" Adafruit SSD1306 OLED to use with my Pi2 and python and ran into a little snag that I thought I’d share in case it helps out anyone else in the same position. I followed the guide here:

https://learn.adafruit.com/ssd1306-oled-displays-with-raspberry-pi-and-beaglebone-black

which I found very helpful but isn’t currently linked from the Pimoroni product page, however there are some other very helpful links there.

I uncommented the correct line in one of the examples for the display I have (128x64) but only one of the examples in the Adafruit library, and not the one I was trying, includes any mention of changing the I2C id and while the default assumed by the library is 3C mine was set up as 3D. This is easy to change, once you know how (thanks @Gadgetoid!). Here is the line that worked for me in the end

disp = ssd1306.SSD1306_128_64(rst=24,i2c_address=0x3D)

You can check the i2c id by running

sudo i2cdetect -y 1

(apparently you may need to change the 1 for a 0 if you have a very early Pi)

1 Like

Thanks for that Gisky!

I’ve added the link to that tutorial on SSD1306 based OLED product pages. :-)

1 Like