Skip to content

Remove stop kwarg and use write_then_readinto. #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions adafruit_mlx90614.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ def _read_temp(self, register):
def _read_16(self, register):
# Read and return a 16-bit unsigned big endian value read from the
# specified 16-bit register address.
with self._device:
with self._device as i2c:
self.buf[0] = register
self._device.write(self.buf, end=1, stop=False)
self._device.readinto(self.buf)
i2c.write_then_readinto(self.buf, self.buf, out_end=1)
return self.buf[1] << 8 | self.buf[0]