Skip to content

Commit 793537e

Browse files
committed
change the i2c init to just read 1 byte
it is not needed to read more than 1 byte just to verify that the i2c device is present
1 parent 796e0a1 commit 793537e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_bus_device/i2c_device.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def __init__(self, i2c, device_address):
6464
while not i2c.try_lock():
6565
pass
6666
try:
67-
result = bytearray(2)
67+
result = bytearray(1)
6868
i2c.readfrom_into(device_address, result)
6969
except OSError:
7070
raise ValueError("No I2C device at address: %x" % device_address)

0 commit comments

Comments
 (0)