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 bfd6a32 + 061e127 commit 31799b9Copy full SHA for 31799b9
adafruit_vl53l1x.py
@@ -48,6 +48,7 @@
48
_SD_CONFIG__INITIAL_PHASE_SD0 = const(0x007A)
49
_SYSTEM__INTERRUPT_CLEAR = const(0x0086)
50
_SYSTEM__MODE_START = const(0x0087)
51
+_VL53L1X_RESULT__RANGE_STATUS = const(0x0089)
52
_VL53L1X_RESULT__FINAL_CROSSTALK_CORRECTED_RANGE_MM_SD0 = const(0x0096)
53
_VL53L1X_IDENTIFICATION__MODEL_ID = const(0x010F)
54
@@ -201,6 +202,8 @@ def model_info(self):
201
202
@property
203
def distance(self):
204
"""The distance in units of centimeters."""
205
+ if self._read_register(_VL53L1X_RESULT__RANGE_STATUS)[0] != 0x09:
206
+ return None
207
dist = self._read_register(
208
_VL53L1X_RESULT__FINAL_CROSSTALK_CORRECTED_RANGE_MM_SD0, 2
209
)
0 commit comments