UIFlow Guide
Change the relay state (ON/OF) every second
from m5stack import *
from m5stack_ui import *
from uiflow import *
import time
import unit
screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xFFFFFF)
relay_0 = unit.get(unit.RELAY, unit.PORTB)
while True:
relay_0.on()
print('Relay ON')
wait(1)
relay_0.off()
print('Relay OFF')
wait(1)
wait_ms(2)
relay_0.off()
relay_0.on()