UIFlow Guide
扫描i2c设备地址并打印到串口
from m5stack import *
from m5stack_ui import *
from uiflow import *
import i2c_bus
screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xFFFFFF)
i2c_bus.easyI2C(i2c_bus.PORTA, 0x00, freq=400000)
i2c0.addr=(0x68)
print(i2c0.scan())
i2c0 = i2c_bus.easyI2C(i2c_bus.PORTA, 0x00, freq=400000)
i2c0 = i2c_bus.easyI2C((0, 0), 0x00, freq=400000)
i2c0.addr=(0x68)
str(i2c0.available())
str(i2c0.scan())
str(i2c0.read_u8((i2c0.scan())))
str(i2c0.read_u16(0x00, byteorder="big"))
str(i2c0.read_reg(0x00, 0))
str(i2c0.read_mem_data(0, 0, i2c_bus.UINT8LE))
str(i2c0.read_data(0, i2c_bus.UINT8LE))
str([][0])
i2c0.write_u8(0x00, 0x00)
i2c0.write_u16(0x00, 0x0000, byteorder="big")
i2c0.write_mem_data(0, 0, i2c_bus.UINT8LE)
i2c0.write_data(0, i2c_bus.UINT8LE)
i2c0.write_mem_list(0, [0, 0, 0])