Search code examples
micropythonesp32

How to access OLED on HTIT-WB32 with Micropython through I2C?


I have Micropython v1.9.2 on an HTIT-wb32 ESP32 board. I can run code, connect to my router, etc. I have not been able to access the built-in OLED display through I2C.

The OLED pin layout for the board states that SDA is on pin 4 and SCL is on pin 15.

So with the code:

from machine import I2C, Pin

i2c = I2C(sda=Pin(4), scl=Pin(15))
i2c.scan()

I should get an address from i2c.scan() but it is returning:

[]

Other code examples I've read seem pretty straightforward and just work but I have not found code for this device yet.

What am I doing wrong?


Solution

  • Not sure if you ever found out, but I just got one of these modules and was experiencing the same issue, found that the OLED reset pin (GPIO16) had to be pulled high first, then shows up as 3c straight away.