UIFlow Guide
输出按钮状态
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
button_0 = unit.get(unit.BUTTON, unit.PORTB)
while True:
if button_0.wasPressed():
print('Pressed')
else:
print('Released')
wait_ms(2)
def button_0_wasPressed_cb():
# global params
pass
button_0.wasPressed(button_0_wasPressed_cb)
print((str('status:') + str((button_0.wasPressed()))))