@@ -163,8 +163,8 @@ class LSM6DS: # pylint: disable=too-many-instance-attributes
163
163
164
164
"""Driver for the LSM6DSOX 6-axis accelerometer and gyroscope.
165
165
166
- :param ~busio.I2C i2c_bus: The I2C bus the LSM6DSOX is connected to.
167
- :param address: The I2C slave address of the sensor
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
168
169
169
"""
170
170
@@ -175,13 +175,12 @@ class LSM6DS: # pylint: disable=too-many-instance-attributes
175
175
_raw_accel_data = Struct (_LSM6DS_OUTX_L_A , "<hhh" )
176
176
_raw_gyro_data = Struct (_LSM6DS_OUTX_L_G , "<hhh" )
177
177
_raw_temp_data = Struct (_LSM6DS_OUT_TEMP_L , "<bb" )
178
-
178
+
179
179
# RWBits:
180
180
181
181
_accel_range = RWBits (2 , _LSM6DS_CTRL1_XL , 2 )
182
182
_accel_data_rate = RWBits (4 , _LSM6DS_CTRL1_XL , 4 )
183
183
184
-
185
184
_gyro_data_rate = RWBits (4 , _LSM6DS_CTRL2_G , 4 )
186
185
_gyro_range = RWBits (2 , _LSM6DS_CTRL2_G , 2 )
187
186
_gyro_range_125dps = RWBit (_LSM6DS_CTRL2_G , 1 )
@@ -254,12 +253,12 @@ def _add_accel_ranges():
254
253
@property
255
254
def temperature (self ):
256
255
raw_temp_data = self ._raw_temp_data
257
-
256
+
258
257
temperature_raw = raw_temp_data [0 ] | (raw_temp_data [1 ] << 8 )
259
258
temperature_c = temperature_raw / 16.0 + 25.0
260
-
259
+
261
260
return temperature_c
262
-
261
+
263
262
@property
264
263
def acceleration (self ):
265
264
"""The x, y, z acceleration values returned in a 3-tuple and are in m / s ^ 2."""
0 commit comments