a18041967
Posts: 15
Joined: Tue Nov 13, 2012 8:40 pm

I2C OLED Display C//C++ Examples

Sun May 16, 2021 8:20 am

I’m desperately trying to configure my Pico to use I2C OLED display 3-5volts SSD1306, I’ve connected the display to the 3v pin and the SCL & SDA to pins 1 & 2 no matter what I try I never seem to get any display, my assumptions so far:

* Pins 1 & 2 are the default I2C interface
* OLED address is 0x78 this translates to 0x3c also tried 0x3d
* Multiple OLEDs tested, to rule out faulty display
* 3-5v is acceptable

I could add the various code that I have tested but I have followed this post:

https://www.element14.com/community/com ... duino-pico

bgolab
Posts: 241
Joined: Sat Jan 30, 2021 12:59 pm

Re: I2C OLED Display C//C++ Examples

Sun May 16, 2021 9:29 am

Many of the OLED modules on the marked are based on SH1106 chip. I used this kind of OLED successfully with the PICO. The 0,91" version.

I would check the chip version.

bgolab
Posts: 241
Joined: Sat Jan 30, 2021 12:59 pm

Re: I2C OLED Display C//C++ Examples

Sun May 16, 2021 9:32 am

I2C address of my chip is set to 0x3C

TommyBurger
Posts: 1
Joined: Sun May 16, 2021 9:04 pm

Re: I2C OLED Display C//C++ Examples

Sun May 16, 2021 9:09 pm

Put:
Wire.setSDA(0);
Wire.setSCL(1);

At the top of setup.

bgolab
Posts: 241
Joined: Sat Jan 30, 2021 12:59 pm

Re: I2C OLED Display C//C++ Examples

Mon May 17, 2021 8:21 am

Have you tried your drivers with the 0x3C address?

a18041967
Posts: 15
Joined: Tue Nov 13, 2012 8:40 pm

Re: I2C OLED Display C//C++ Examples

Mon May 17, 2021 2:31 pm

I’m making slow but good progress and decided to test using Python, I initially did a i2c scan which confirmed the address as being 0x3c and then I realised that I was using the wrong PIN numbers. I’d been using the actual PIN numbers 1 & 2 and I realised I should be using the GPIO numbers 0 & 1 and this resulted in success. So I now now know the correct address, PIN numbers and that the displays are all OK, I have tried C and still no success but that needs more work.

Return to “General”