robert-hh / SH1106

MicroPython driver for the SH1106 OLED controller
Other
163 stars 38 forks source link

Constructor needs an id? #24

Closed chard62 closed 2 years ago

chard62 commented 2 years ago

I am using SH1106 library to use the OLED display with a Raspberry Pi Pico. The error I see is as follows:

MicroPython v1.19.1 on 2022-06-18; Raspberry Pi Pico with RP2040

Type "help()" for more information.

%Run -c $EDITOR_CONTENT Traceback (most recent call last): File "", line 12, in TypeError: 'id' argument required

In your documentation, I see no mention of "id". If I add "id=0" to the constructor, it works, I get no error. My constructor is now: "i2c = I2C( id=0, sda=sda, scl=scl, freq=400000)"

robert-hh commented 2 years ago

The examples are for the ESP8266 port which does not required the id argument. Other ports like the RPi 2040 do. So that has to be adapted. Since the ESP8266 is rarely used now, maybe the examples have to be updated.