Hi, I trying to use new TH v2 sensor with RPI3 and GrovePi+ and I encounter problem with importing machine lib in micropython v1.17, no module named 'machine.I2C:
MicroPython v1.17 on 2021-09-06; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
from machine import I2C
Traceback (most recent call last):
File “”, line 1, in
ImportError: no module named ‘machine.I2C’import machine
dir(machine)
[‘class’, ‘name’, ‘file’, ‘path’, ‘PinBase’, ‘Signal’, ‘array’, ‘idle’, ‘mem16’, ‘mem32’, ‘mem8’, ‘time_pulse_us’, ‘uctypes’, ‘umachine’, ‘uos’, ‘utime’, ‘os’, ‘timer’, ‘pin’, ‘unique_id’, ‘ffilib’, ‘signal’, ‘libc’, ‘librt’, ‘CLOCK_REALTIME’, ‘CLOCK_MONOTONIC’, ‘SIGEV_SIGNAL’, ‘sigval_t’, ‘sigevent_t’, ‘timespec_t’, ‘itimerspec_t’, ‘SIGRTMIN’, ‘timer_create_’, ‘timer_settime_’, ‘new’, ‘timer_create’, ‘timer_settime’, ‘Timer’, ‘SIG_DFL’, ‘SIG_IGN’, ‘SIGINT’, ‘SIGPIPE’, ‘SIGTERM’, ‘signal_i’, ‘signal_p’, ‘Pin’]
Same issue on PI Zero also. Am I doing something wrong? Thank you for help.
i2cdetect seems to be working:
i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – 04 – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- 38 – -- – -- – -- –
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --