Skip to content

Commit a358476

Browse files
authored
Merge pull request #12 from tannewt/remove_stop
Remove stop kwarg and use write_then_readinto.
2 parents 71dfd9f + 0d2ed4e commit a358476

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

adafruit_pcf8523.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ def __init__(self, i2c_bus):
108108
buf = bytearray(2)
109109
buf[0] = 0x12
110110
with self.i2c_device as i2c:
111-
i2c.write(buf, end=1, stop=False)
112-
i2c.readinto(buf, start=1)
111+
i2c.write_then_readinto(buf, buf, out_end=1, in_start=1)
113112

114113
if (buf[1] & 0b00000111) != 0b00000111:
115114
raise ValueError("Unable to find PCF8523 at i2c address 0x68.")

0 commit comments

Comments
 (0)