2
2
#
3
3
# SPDX-License-Identifier: MIT
4
4
"""
5
- This module provides the `adafruit_lsm6ds.lsm6ds3 ` subclass of LSM6DS sensors
5
+ This module provides the `adafruit_lsm6ds.lsm6ds3trc ` subclass of LSM6DS sensors
6
6
===============================================================================
7
7
"""
8
- from . import LSM6DS
8
+ from . import LSM6DS , RWBit , const
9
9
10
+ _LSM6DS_CTRL10_C = const (0x19 )
10
11
11
- class LSM6DS3 (LSM6DS ): # pylint: disable=too-many-instance-attributes
12
12
13
- """Driver for the LSM6DS3 6-axis accelerometer and gyroscope.
13
+ class LSM6DS3TRC ( LSM6DS ): # pylint: disable=too-many-instance-attributes
14
14
15
- :param ~busio.I2C i2c_bus: The I2C bus the LSM6DS3 is connected to.
15
+ """Driver for the LSM6DS3TR-C 6-axis accelerometer and gyroscope.
16
+
17
+ :param ~busio.I2C i2c_bus: The I2C bus the LSM6DS3TR-C is connected to.
16
18
:param int address: The I2C device address. Defaults to :const:`0x6A`
17
19
18
20
19
21
**Quickstart: Importing and using the device**
20
22
21
- Here is an example of using the :class:`LSM6DS3 ` class.
23
+ Here is an example of using the :class:`LSM6DS3TRC ` class.
22
24
First you will need to import the libraries to use the sensor
23
25
24
26
.. code-block:: python
25
27
26
28
import board
27
- from adafruit_lsm6ds.lsm6ds3 import LSM6DS3
29
+ from adafruit_lsm6ds.lsm6ds3trc import LSM6DS3TRC
28
30
29
31
Once this is done you can define your `board.I2C` object and define your sensor object
30
32
31
33
.. code-block:: python
32
34
33
35
i2c = board.I2C() # uses board.SCL and board.SDA
34
- sensor = LSM6DS3 (i2c)
36
+ sensor = LSM6DS3TRC (i2c)
35
37
36
38
Now you have access to the :attr:`acceleration` and :attr:`gyro`: attributes
37
39
@@ -43,3 +45,7 @@ class LSM6DS3(LSM6DS): # pylint: disable=too-many-instance-attributes
43
45
"""
44
46
45
47
CHIP_ID = 0x6A
48
+
49
+ # This version of the IMU has a different register for enabling the pedometer
50
+ # https://www.st.com/resource/en/datasheet/lsm6ds3tr-c.pdf
51
+ _ped_enable = RWBit (_LSM6DS_CTRL10_C , 4 )
0 commit comments