- i2c.writeto(0x18, bytes([0x05]), stop=False)
- result = bytearray(2)
- i2c.readfrom_into(0x18, result)
- print(temp_c(result))
- time.sleep(0.5)
+ for i2c in i2c_devices:
+ addrbuf = bytearray(2)
+ addrbuf[0] = ADDRID1 >> 8
+ addrbuf[1] = ADDRID1 & 0xFF
+ inbuf = bytearray(6)
+ i2c.writeto_then_readfrom(MLXADDR, addrbuf, inbuf)
+ print("Device " + str(i2c_devices.index(i2c)) + ": ")
+ print(inbuf)
+ time.sleep(0.5)