adafruit / Adafruit_CircuitPython_LSM6DS

CircuitPython helper library for the LSM6DS family of motion sensors from ST
MIT License
25 stars 21 forks source link

High pass filter not working for LSM6DSOX #62

Open bobu01 opened 1 year ago

bobu01 commented 1 year ago

The __init__.py file does not support high-pass filter (HPF) settings for LSM6DSOX sensor. The LSM6DSOX has a different control register configuration compared to other IMU parts supported by this library. This is in register _LSM6DS_CTRL8_XL.

I've modified the __init__.py file as a test and it seems to work OK with LSM6DSOX. This is tested using Adafruit STM32F405 Feather and the LSM6DSOX board with a I2C connection. The HPF filters out steady-state (gravity) and passes motions. This file will break the library for other IMU parts. I don't know enough to make this work for all the parts. init.py.zip

Thanks for this library Regards, Bob U.

Pweder3 commented 6 months ago

isnt the bit selected by the high_pass_filter property RWBits(2, _LSM6DS_CTRL8_XL, 5) selecting the wrong bit. isnt the bandwidth selected by the first 3 bits not by bits 5 and 6?