Skip to content

Commit da47e6d

Browse files
authored
Merge pull request #27 from KeithTheEE/crc_fix
CRC Mismatch fix
2 parents 028731e + 66a24d7 commit da47e6d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_sht31d.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ def _crc(data):
115115
for _ in range(8):
116116
if crc & 0x80:
117117
crc <<= 1
118-
crc ^= 0x131
118+
crc ^= 0x31
119119
else:
120120
crc <<= 1
121-
return crc
121+
return crc & 0xFF
122122

123123

124124
def _unpack(data):

0 commit comments

Comments
 (0)