targetblank / micropython_ahtx0

MicroPython driver for the AHT10 and AHT20 temperature and humidity sensors.
MIT License
32 stars 8 forks source link

error while running the file #2

Closed guy111a closed 2 years ago

guy111a commented 2 years ago

Hello

connected the aht10 to pi pico, saved 2 files and run the example, i get the next error:

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

i can see the address "0x38" of the sensor with i2c scanner.

i was trying to understand what is the missing ID .. but cannot, please help ! Thank you

guy111a commented 2 years ago

ok, found it.

i2c = I2C(0, scl=Pin(1), sda=Pin(0)) # added 0,

targetblank commented 2 years ago

Seems like the machine.I2C constructor behaves a bit different on Pi Pico compared to the ESP8266 boards (where I tested the example). Closing this issue...