Skip to content

Commit cfd56fb

Browse files
committed
Response from the sensor is only one byte, so unpack needs to accept a single byte instead of a short
1 parent 669b01e commit cfd56fb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bmp180.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ def pressure(self):
150150
next(self.gauge)
151151
self.temperature # Populate self.B5_raw
152152
try:
153-
MSB = unp('<h', self.MSB_raw)[0]
154-
LSB = unp('<h', self.LSB_raw)[0]
155-
XLSB = unp('<h', self.XLSB_raw)[0]
153+
MSB = unp('B', self.MSB_raw)[0]
154+
LSB = unp('B', self.LSB_raw)[0]
155+
XLSB = unp('B', self.XLSB_raw)[0]
156156
except:
157157
return 0.0
158158
UP = ((MSB << 16)+(LSB << 8)+XLSB) >> (8-self.oversample_setting)

0 commit comments

Comments
 (0)