Я пытаюсь собрать простую воздушную мышь с гироскопом/ускорением на основе Seeed nRF52840. Я пробовал много разных способов сделать это, но моя текущая настройка/проблема такова.
Error:
Initializing sensor...
Failed to initialize sensor: cannot create 'Pin' instances
Traceback (most recent call last):
File "code.py", line 48, in
TypeError: cannot create 'Pin' instances
Код:
print("Initializing sensor...")
try:
scl_pin = Pin(board.SCL)
sda_pin = Pin(board.SDA)
scl_pin.pull = Pin.PULL_UP
sda_pin.pull = Pin.PULL_UP
print("I2C pins configured with pull-ups")
i2c = busio.I2C(board.SCL, board.SDA, frequency=100000)
timeout = time.monotonic() + 5
while not i2c.try_lock() and time.monotonic() < timeout:
pass
if time.monotonic() >= timeout:
raise RuntimeError("Failed to lock I2C bus")
print("Scanning I2C bus...")
devices = i2c.scan()
print("Found devices at:", [hex(x) for x in devices])
i2c.unlock()
if not devices:
raise RuntimeError("No I2C devices found")
sensor = adafruit_lsm6ds.lsm6ds33.LSM6DS33(i2c)
print("Sensor initialized successfully")
Подробнее здесь: https://stackoverflow.com/questions/793 ... ope-workin
Видел, что у nRF52840 возникли проблемы с работой акселерометра и гироскопа для воздушной мыши. ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Возникли проблемы с работой django-simple-captcha на моей странице контактов.
Anonymous » » в форуме Python - 0 Ответы
- 20 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Как сделать так, чтобы никто не видел трафик запросов в питоне [закрыто]
Anonymous » » в форуме Python - 0 Ответы
- 22 Просмотры
-
Последнее сообщение Anonymous
-