UIFlow Guide
from m5stack import *
from m5ui import *
from uiflow import *
setScreenColor(0x222222)
while True:
print('Hello M5')
wait_ms(2)
while True:
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
setScreenColor(0x222222)
def multiBtnCb_AB():
# global params
print('Button A + B Pressed')
pass
btn.multiBtnCb(btnA,btnB,multiBtnCb_AB)
def buttonA_wasPressed():
# global params
print('Button A Pressed')
pass
btnA.wasPressed(buttonA_wasPressed)
while True:
if btnB.wasPressed():
print('Button B wasPressed')
if btnC.isPressed():
print('Button C Pressed')
wait_ms(2)
btn = btn.attach([pin])
def buttonA_wasPressed():
# global params
print('Button A Pressed')
pass
btnA.wasPressed(buttonA_wasPressed)
def multiBtnCb_AB():
# global params
print('Button A + B Pressed')
pass
btn.multiBtnCb(btnA,btnB,multiBtnCb_AB)
if btnB.wasPressed():
print('Button B wasPressed')
if btnC.isPressed():
print('Button C Pressed')
from m5stack import *
from m5ui import *
from uiflow import *
setScreenColor(0x222222)
@timerSch.event('timer1')
def ttimer1():
# global params
print('This is a software timer!')
pass
timerSch.setTimer('timer1', 100, 0x00)
timerSch.run('timer1', 100, 0x00)
@timerSch.event('timer1')
def ttimer1():
# global params
pass
timerSch.setTimer('timer1', 100, 0x00)
timerSch.run('timer1', 100, 0x00)
timerSch.stop('timer1')
from m5stack import *
from m5ui import *
from uiflow import *
setScreenColor(0x222222)
def callback_timer3(_arg):
# global params
print('This is a hardware timer!')
pass
timerSch.timer.init(period=100, mode=timerSch.timer.PERIODIC, callback=callback_timer3)
def callback_timer3(_arg):
pass
timerSch.timer.init(period=100, mode=timerSch.timer.PERIODIC, callback=callback_timer3)