Skip to content

Commit f47d0c8

Browse files
authored
Merge pull request #500 from s2terminal/fix-analog-read
fix analogRead not returning a value Other users have found this fix also works for them. Thank you for your contribution
2 parents fc21395 + d3ff6df commit f47d0c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Software/Python/grovepi.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def read_i2c_block(no_bytes = max_recv_size):
238238

239239
def read_identified_i2c_block(read_command_id, no_bytes):
240240
data = [-1]
241-
while data[0] != read_command_id[0]:
241+
while len(data) <= 1:
242242
data = read_i2c_block(no_bytes + 1)
243243

244244
return data[1:]

0 commit comments

Comments
 (0)