pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Unit Limit

案例程序

输出按钮状态

from m5stack import *
from m5ui import *
from uiflow import *
import unit

setScreenColor(0x222222)
limit_0 = unit.get(unit.LIMIT, unit.PORTB)

while True:
  if limit_0.get_switch_status():
    print((str('Button:') + str((limit_0.get_switch_status()))))
  else:
    print((str('Button:') + str((limit_0.get_switch_status()))))
  wait_ms(2)

功能说明

print((str('status:') + str((limit_0.get_switch_status()))))
  • 获取当前按钮状态
On This Page