We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b369946 + a04e9ed commit 4c14417Copy full SHA for 4c14417
adafruit_bme680.py
@@ -385,10 +385,13 @@ def _perform_reading(self) -> None:
385
ctrl = (ctrl & 0xFC) | 0x01 # enable single shot!
386
self._write(_BME680_REG_CTRL_MEAS, [ctrl])
387
new_data = False
388
+ start_time = time.monotonic()
389
while not new_data:
390
data = self._read(_BME680_REG_MEAS_STATUS, 17)
391
new_data = data[0] & 0x80 != 0
392
time.sleep(0.005)
393
+ if start_time >= time.monotonic() - 3.0:
394
+ raise RuntimeError("Timeout while reading sensor data")
395
self._last_reading = time.monotonic()
396
397
self._adc_pres = _read24(data[2:5]) / 16
0 commit comments