UIFlow Guide
输出按钮状态
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
limit_0 = unit.get(unit.LIMIT, unit.PORTB)
dual_button_0 = unit.get(unit.DUAL_BUTTON, unit.PORTB)
while True:
if limit_0.get_switch_status():
print('Blue button pressed')
else:
print('Red button pressed')
wait_ms(2)
print((str('status:') + str((limit_0.get_switch_status()))))