Skip to content

Commit 9b1b886

Browse files
committed
Correction of get_i2c()
1 parent ddfa77e commit 9b1b886

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

LiveObjects/hal.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ def get_i2c():
246246
i2c = machine.SoftI2C(scl=machine.Pin(scl), sda=machine.Pin(sda), freq=100000)
247247
if i2c.scan() and len(i2c.scan()) < MAX_DEV_NB:
248248
return i2c
249+
except ValueError: # next sda, scl
250+
pass
249251
except AttributeError: # Pycom MicroPython 1.20.2.r6 [v1.11-c5a0a97] on 2021-10-28
250252
i2c = machine.I2C(0)
251253
return i2c

0 commit comments

Comments
 (0)