We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d8f3c0a + e31548e commit 98653eeCopy full SHA for 98653ee
adafruit_lsm6ds/__init__.py
@@ -158,7 +158,8 @@ class AccelHPF(CV):
158
_LSM6DS_TAP_CFG = const(0x58)
159
_LSM6DS_MLC0_SRC = const(0x70)
160
_MILLI_G_TO_ACCEL = 0.00980665
161
-
+_TEMPERATURE_SENSITIVITY = 256
162
+_TEMPERATURE_OFFSET = 25.0
163
164
_LSM6DS_EMB_FUNC_EN_A = const(0x04)
165
_LSM6DS_EMB_FUNC_EN_B = const(0x05)
@@ -399,10 +400,7 @@ def temperature(self) -> float:
399
400
401
temp = self._raw_temp_data[0]
402
- if temp > 0x550:
403
- return (temp - 2 ** 13) * 0.0625
404
405
- return temp * 0.0625
+ return temp / _TEMPERATURE_SENSITIVITY + _TEMPERATURE_OFFSET
406
407
def _set_embedded_functions(self, enable, emb_ab=None):
408
"""Enable/disable embedded functions - returns prior settings when disabled"""
0 commit comments