Skip to content

Commit f7a6366

Browse files
authored
Merge pull request #11 from tannewt/remove_stop
Remove stop kwarg and use write_then_readinto.
2 parents 55b1819 + fb96e0a commit f7a6366

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

adafruit_ds1307.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ def __init__(self, i2c_bus):
7878
buf = bytearray(2)
7979
buf[0] = 0x07
8080
with self.i2c_device as i2c:
81-
i2c.write(buf, end=1, stop=False)
82-
i2c.readinto(buf, start=1)
81+
i2c.write_then_readinto(buf, buf, out_end=1, in_start=1)
8382

8483
if (buf[1] & 0b00000011) != 0b00000011:
8584
raise ValueError("Unable to find DS1307 at i2c address 0x68.")

0 commit comments

Comments
 (0)