2

Just trying to understand what's going on here. i2c.scan() returns [60], as in should.

from machine import Pin, I2C
import ssd1306

i2c = I2C(0, sda=Pin(0), scl=Pin(1), freq=400000)

oled=ssd1306.SSD1306_I2C(128, 64, i2c)

Traceback (most recent call last):
    File "<stdin>", line 6, in <module>
    File "/lib/ssd1306.py", line 110, in __init__
    File "/lib/ssd1306.py", line 36, in __init__
    File "/lib/ssd1306.py", line 73, in init_display
    File "/lib/ssd1306.py", line 101, in show
    File "/lib/ssd1306.py", line 119, in write_data
OSError: [Errno 5] EIO
Jonas
  • 121,568
  • 97
  • 310
  • 388

2 Answers2

2

Use the pico_ssd1306 driver and run the following code:

from machine import Pin, I2C
from ssd1306 import SSD1306_I2C

i2c = I2C(0,sda=Pin(16),scl=Pin(17),freq=40000)
oled = SSD1306_I2C(128,64,i2c)

oled.fill(0)
oled.text("Hello",0,0)
Sercan
  • 4,739
  • 3
  • 17
  • 36
0

plz check your OLED is support I2C or SPI ? If its SPI mode use SSD1306_SPT.