Skip to content

Commit 1669893

Browse files
authored
Merge pull request #12 from tannewt/remove_stop
Remove stop kwarg and use write_then_readinto.
2 parents 0709e3e + 0cc7ace commit 1669893

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

adafruit_mlx90614.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ def _read_temp(self, register):
121121
def _read_16(self, register):
122122
# Read and return a 16-bit unsigned big endian value read from the
123123
# specified 16-bit register address.
124-
with self._device:
124+
with self._device as i2c:
125125
self.buf[0] = register
126-
self._device.write(self.buf, end=1, stop=False)
127-
self._device.readinto(self.buf)
126+
i2c.write_then_readinto(self.buf, self.buf, out_end=1)
128127
return self.buf[1] << 8 | self.buf[0]

0 commit comments

Comments
 (0)