Skip to content

Commit 69ab50f

Browse files
committed
Getting the chip ID
1 parent 98f6815 commit 69ab50f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_shtc3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def __init__(self, i2c_bus):
119119
self.sleeping = False
120120
self.reset()
121121
self._chip_id = self._get_chip_id()
122-
if self._chip_id & 0x083F != _SHTC3_CHIP_ID:
122+
if self._chip_id != _SHTC3_CHIP_ID:
123123
raise RuntimeError("Failed to find an SHTC3 sensor - check your wiring!")
124124

125125
def _write_command(self, command):
@@ -137,7 +137,7 @@ def _get_chip_id(self): # readCommand(SHTC3_READID, data, 3);
137137
with self.i2c_device as i2c:
138138
i2c.readinto(self._buffer)
139139

140-
return unpack_from(">H", self._buffer)[0]
140+
return unpack_from(">H", self._buffer)[0] & 0x083F
141141

142142
def reset(self):
143143
"""Perform a soft reset of the sensor, resetting all settings to their power-on defaults"""

0 commit comments

Comments
 (0)