Skip to content

Commit 9c24271

Browse files
authored
Fixed I2C Status Bit
Memory integrity/error occurs when I2C status bit 2 is 0x01. Not when I2C status bit 0 is 0x04 (as implemented by Adafruit). See page 14 on the datasheet: https://sensing.honeywell.com/honeywell-sensing-micropressure-board-mount-pressure-mpr-series-datasheet-32332628.pdf >>> print(mpr.pressure) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.7/site-packages/adafruit_mprls.py", line 99, in pressure return self._read_data() File "/usr/local/lib/python3.7/site-packages/adafruit_mprls.py", line 127, in _read_data raise RuntimeError("Integrity failure") RuntimeError: Integrity failure
1 parent 4a97704 commit 9c24271

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_mprls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def _read_data(self):
123123
# check other status bits
124124
if self._buffer[0] & 0x01:
125125
raise RuntimeError("Internal math saturation")
126-
if self._buffer[0] & 0x04:
126+
if self._buffer[2] & 0x01:
127127
raise RuntimeError("Integrity failure")
128128

129129
# All is good, calculate the PSI and convert to hPA

0 commit comments

Comments
 (0)