UIFlow Guide
from m5stack import *
from m5ui import *
from uiflow import *
import module
import time
setScreenColor(0x222222)
i = None
module_4in8out = module.get(module.MODULE_4IN8OUT)
module_4in8out.init_i2c_address(0x45)
print((str('Module Firmware Version:') + str((module_4in8out.read_status(0XFE)))))
while True:
for i in range(8):
module_4in8out.write_output_pin(i, 1)
wait(1)
for i in range(8):
module_4in8out.write_output_pin(i, 0)
wait(1)
for i in range(4):
print((str('CH') + str(((str(i) + str(((str(' Input :') + str((module_4in8out.read_input_pin(i)))))))))))
wait_ms(2)
module_4in8out.init_i2c_address(0x45)
module_4in8out.read_input_pin(0)
module_4in8out.read_status(0XFE))
module_4in8out.set_i2c_address(0x45)
module_4in8out.write_output_pin(0, 1)