I got a adafruit FT232H board.
I setuped environment and scaned I2C bus that can find my I2C device.
As screenshot I can find my slave device (addr : 0x0b), but I will got error while send data to it.
Code: Select all
import time
import board # need to set BLINKA_FT232H=1 from system environment variable...PK 20221125+
# To use default I2C bus (most boards)
i2c = board.I2C()
while not i2c.try_lock():
pass
try:
while True:
print(
"I2C addresses found:",
[hex(device_address) for device_address in i2c.scan()],
)
# i2c.writeto(0x0B, bytes([0x44, 0x01,0x00]))
i2c.writeto(0x0b, bytes([0x08]), stop=True)
result = bytearray(2)
i2c.readfrom_into(0x0b, result)
# result
time.sleep(2)
finally: # unlock the i2c bus when ctrl-c'ing out of the loop
i2c.unlock()
Thanks for your suppot.
============================
Environment informaion :
- Windows : Windows 10 Enterprise
- Board : Adafruit FT232H
- Python : v3.10.8
============================