oled screen whit i2c how do i activate it scl=Pin(17), sda=Pin(16))


Author Message
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 3150
Posted: 07:54am 08 Jun 2025      

The first step is to find out what controller chip it has. In the manual there is a chapter on display panels. After SPI displays are the I2C displays. See if your chip is listed there.
The only OLED I can see is this:-
  Quote  To setup the system I2C bus use the command:
OPTION SYSTEM I2C sdapin, sclpin

OPTION LCDPANEL SSD1306I2C, OR [,offset]
Initialises a OLED display using the SSD1306 controller with an I2C interface. This supports 128 * 64 resolution.
An additional parameter offset may be specified to control the position of the display. 0.96" displays typically
need a value of 0. 1.3" displays typically need a value of 2. Default if omitted is 0.
NB many cheap I2C versions of SSD1306 displays do not implement I2C properly due to a wiring error. This
seems to be particularly the case with 1.3" variants
OPTION LCDPANEL SSD1306I2C32, OR
Initialises a OLED display using the SSD1306 controller with an I2C interface. This supports 128 * 32 resolution