Commit 5299d8de authored by Ivan Tyagov's avatar Ivan Tyagov

Failed to communicate over I2C - retry until successfull , debug later.

parent 9f09b5c2
......@@ -89,11 +89,12 @@ def sendI2Ccommand(code):
# init I2C
i2c.init("/dev/i2c-1")
i2c.open(0x58)
try:
i2c.write([0x10, code])
except:
print("Failed co sent command.")
while 1:
try:
i2c.write([0x10, code])
break
except:
print("Failed co sent command.")
i2c.close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment