pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Unit LCD

Output button state

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)

API

print((str('status:') + str((limit_0.get_switch_status()))))
  • Gets the current button status
On This Page