PCA9536读写测试之MicroPython
import machine i2c = machine.I2C(scl = machine.Pin(22), sda = machine.Pin(23), freq = 100000) #初始化I2C i2c.writeto_mem(65, 3,b'\xff') #PCA9536 地址0x41(65) 发送 0x03(3) 0xff print(i2c.readfrom_mem(65, 0,1)) #读取PCA9536 地址0x41(65) 0x00 一个字节
参考地址:https://github.com/ControlEverythingCommunity/PCA9536/blob/master/Python/PCA9536.py