Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions examples/lsm6ds_pedometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@
from adafruit_lsm6ds import AccelRange, Rate

# pylint:disable=no-member
from adafruit_lsm6ds.lsm6ds33 import LSM6DS33
# Import the correct class for the sensor that you have.
# Change the import as needed. Not all are listed here.
# Note that the LSM6DS3TRC, which is used on the Adafruit Feather Sense,
# uses a different I2C register to enable the pedometer,
# so the device classes are not interchangeable.
#
# from adafruit_lsm6ds.lsm6ds33 import LSM6DS33 as LSM
from adafruit_lsm6ds.lsm6ds3trc import LSM6DS3TRC as LSM

i2c = board.I2C() # uses board.SCL and board.SDA
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
sensor = LSM6DS33(i2c)
sensor = LSM(i2c)

# enable accelerometer sensor @ 2G and 26 Hz
sensor.accelerometer_range = AccelRange.RANGE_2G
Expand Down