pdf-icon

UIFlow Guide

UiFlow1 Blockly

Event

Unit

UiFlow1 Project

Unit Limit

Output button state

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)

API

print((str('status:') + str((limit_0.get_switch_status()))))
  • Gets the current button status
On This Page
API
Q&A
Submit a question
Select question category*
Arduino
MicroPython
UIFlow1
UIFlow2
EzData
M5Burner
Software
Hardware
Other
Product name
Product version
Question description*
(Supports pasting screenshots.)
Attachments
Add Files
Email*
Submit
OK

M5Stack Support

Hi, this is M5Stack Support. How can I help you today?