Using an SSD1306 with a Pi Pico in the Arduino IDE

I get that this is that Arduino forum but I figured that since its the Arduino IDE that you guys might be a bit more familiar with C++. I'm attempting to use an SSD1306 with a pi pico but nothing shows up on screen. I am using the default SCL and SDA pins on the pi pico but nothing happens. I suspect that this has something to do with the Arduino SDA and SCL pins being different than the pi pico ones or them just not being defined properly.

So here's the real question, How do I define the I2C pins on the in my code to work with the OLED SSD1306 and other I2C devices

Post a link to the actual display that you have bought. e.g. Ebay sale page.

Run all of the Adafruit_SSD1306 library I2C examples. Connect SDA, SCL to the default pins.
From C:\Users\David Prentice\AppData\Local\Arduino15\packages\arduino\hardware\mbed_rp2040\2.2.0\variants\RASPBERRY_PI_PICO\pins_arduino.h

// Wire
#define PIN_WIRE_SDA        (6u)
#define PIN_WIRE_SCL        (7u)

Note that most 128x64 displays are 0x3C but branded Adafruit models are 0x3D

Incidentally, you can use non-default I2C pins but this requires a more complex constructor statement.


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