Skip to content

Commit 2bf5c7f

Browse files
authored
Merge pull request #67 from adafruit/dhalbert-patch-2
Fix Pedometer example for LSM6DS3TRC
2 parents e7da74f + df156e9 commit 2bf5c7f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

examples/lsm6ds_pedometer.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,18 @@
1212
from adafruit_lsm6ds import AccelRange, Rate
1313

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

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

2128
# enable accelerometer sensor @ 2G and 26 Hz
2229
sensor.accelerometer_range = AccelRange.RANGE_2G

0 commit comments

Comments
 (0)