Skip to content

Commit 395ddb7

Browse files
authored
Merge pull request #18 from tannewt/remove_stop
Remove stop kwarg and use write_then_readinto.
2 parents 0e8b9ae + df2037b commit 395ddb7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

adafruit_ds3231.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ def __init__(self, i2c):
101101
buf = bytearray(2)
102102
buf[0] = 0x0e
103103
with self.i2c_device as i2c_device:
104-
i2c_device.write(buf, end=1, stop=False)
105-
i2c_device.readinto(buf, start=1)
104+
i2c_device.write_then_readinto(buf, buf, out_end=1, in_start=1)
106105

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

0 commit comments

Comments
 (0)