0

只是想了解这里发生了什么。i2c.scan() 应该返回 [60]。

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
4

1 回答 1

1

使用pico_ssd1306驱动程序并运行以下代码:

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)
于 2022-01-10T17:59:15.443 回答