Skip to content

Commit

Permalink
Merge pull request #18 from tannewt/remove_stop
Browse files Browse the repository at this point in the history
Remove stop kwarg and use write_then_readinto.
  • Loading branch information
kattni authored Aug 27, 2019
2 parents 0e8b9ae + df2037b commit 395ddb7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions adafruit_ds3231.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ def __init__(self, i2c):
buf = bytearray(2)
buf[0] = 0x0e
with self.i2c_device as i2c_device:
i2c_device.write(buf, end=1, stop=False)
i2c_device.readinto(buf, start=1)
i2c_device.write_then_readinto(buf, buf, out_end=1, in_start=1)

if (buf[1] & 0b00011000) != 0b00011000:
raise ValueError("Unable to find DS3231 at i2c address 0x68.")
Expand Down

0 comments on commit 395ddb7

Please sign in to comment.