I am trying to get the movement sensor (LSM6DSOX ) to work using python

I am trying to get the movement sensor to work using python.
I am using Thonny to upload and the latest stable micropython firmware from here: https://downloads.arduino.cc/micropython/ARDUINO_NANO_RP2040_CONNECT-20240222-v1.22.2.uf2
This basic code:

import machine
import time
from lsm6dsox import LSM6DSOX
from machine import Pin, SPI, I2C
time.sleep_ms(20)
i2c=I2C(0, scl=Pin(13), sda=Pin(12))
print(str(i2c))
lsm = LSM6DSOX(i2c, gyro_odr = 26, accel_odr = 26, gyro_scale = 2000, accel_scale = 4)

Gives this error:

MPY: soft reboot
I2C(0, freq=399361, scl=13, sda=12, timeout=50000)
Traceback (most recent call last):
  File "<stdin>", line 8, in <module>
  File "lsm6dsox.py", line 1, in __init__
  File "lsm6dsox.py", line 1, in _read_reg
OSError: [Errno 116] ETIMEDOUT

I believe I have the LSM6DSOX module loaded correctly; I installed it (the lsm6dsox.py file is in the /lib/ folder) Not sure what the issue is.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.