File tree 5 files changed +17
-10
lines changed
5 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -164,8 +164,7 @@ class LSM6DS: # pylint: disable=too-many-instance-attributes
164
164
"""Driver for the LSM6DSOX 6-axis accelerometer and gyroscope.
165
165
166
166
:param ~busio.I2C i2c_bus: The I2C bus the LSM6DSOX is connected to.
167
- :param address: The I2C slave address of the sensor
168
-
167
+ :param address: The I2C address of the sensor
169
168
"""
170
169
171
170
# ROUnaryStructs:
@@ -174,6 +173,8 @@ class LSM6DS: # pylint: disable=too-many-instance-attributes
174
173
# Structs
175
174
_raw_accel_data = Struct (_LSM6DS_OUTX_L_A , "<hhh" )
176
175
_raw_gyro_data = Struct (_LSM6DS_OUTX_L_G , "<hhh" )
176
+ _raw_temp_data = Struct (_LSM6DS_OUT_TEMP_L , "<bb" )
177
+
177
178
# RWBits:
178
179
179
180
_accel_range = RWBits (2 , _LSM6DS_CTRL1_XL , 2 )
@@ -248,6 +249,16 @@ def _add_accel_ranges():
248
249
)
249
250
)
250
251
252
+ @property
253
+ def temperature (self ):
254
+ """The temperature, in degrees Celsius."""
255
+ raw_temp_data = self ._raw_temp_data
256
+
257
+ temperature_raw = raw_temp_data [0 ] | (raw_temp_data [1 ] << 8 )
258
+ temperature_c = temperature_raw / 16.0 + 25.0
259
+
260
+ return temperature_c
261
+
251
262
@property
252
263
def acceleration (self ):
253
264
"""The x, y, z acceleration values returned in a 3-tuple and are in m / s ^ 2."""
Original file line number Diff line number Diff line change @@ -15,8 +15,7 @@ class ISM330DHCX(LSM6DS): # pylint: disable=too-many-instance-attributes
15
15
"""Driver for the LSM6DS33 6-axis accelerometer and gyroscope.
16
16
17
17
:param ~busio.I2C i2c_bus: The I2C bus the LSM6DS33 is connected to.
18
- :param address: The I2C slave address of the sensor
19
-
18
+ :param address: The I2C address of the sensor
20
19
"""
21
20
22
21
CHIP_ID = 0x6B
Original file line number Diff line number Diff line change @@ -12,8 +12,7 @@ class LSM6DS33(LSM6DS): # pylint: disable=too-many-instance-attributes
12
12
"""Driver for the LSM6DS33 6-axis accelerometer and gyroscope.
13
13
14
14
:param ~busio.I2C i2c_bus: The I2C bus the LSM6DS33 is connected to.
15
- :param address: The I2C slave address of the sensor
16
-
15
+ :param address: The I2C address of the sensor
17
16
"""
18
17
19
18
CHIP_ID = 0x69
Original file line number Diff line number Diff line change @@ -12,8 +12,7 @@ class LSM6DSO32(LSM6DS): # pylint: disable=too-many-instance-attributes
12
12
"""Driver for the LSM6DSO32 6-axis accelerometer and gyroscope.
13
13
14
14
:param ~busio.I2C i2c_bus: The I2C bus the LSM6DSO32 is connected to.
15
- :param address: The I2C slave address of the sensor
16
-
15
+ :param address: The I2C address of the sensor
17
16
"""
18
17
19
18
CHIP_ID = LSM6DS_CHIP_ID
Original file line number Diff line number Diff line change @@ -12,8 +12,7 @@ class LSM6DSOX(LSM6DS): # pylint: disable=too-many-instance-attributes
12
12
"""Driver for the LSM6DSOX 6-axis accelerometer and gyroscope.
13
13
14
14
:param ~busio.I2C i2c_bus: The I2C bus the LSM6DSOX is connected to.
15
- :param address: The I2C slave address of the sensor
16
-
15
+ :param address: The I2C address of the sensor
17
16
"""
18
17
19
18
CHIP_ID = LSM6DS_CHIP_ID
You can’t perform that action at this time.
0 commit comments