UIFlow Guide
Initialize the direction of the pin, and print the value of the pin on the screen.
from m5stack import *
from m5stack_ui import *
from uiflow import *
import machine
import time
screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xFFFFFF)
i = None
label0 = M5Label('label0', x=137, y=88, color=0x000, font=FONT_MONT_14, parent=None)
PWM0 = machine.PWM(26, freq=50, duty=3, timer=0)
while True:
for i in range(13):
PWM0.duty(i)
wait_ms(1000)
label0.set_text(str(i))
wait_ms(2)
machine.PWM(26, freq=10000, duty=50, timer=0)
PWM0.freq(1)
PWM0.duty(0)
PWM0.pause()
PWM0.resume()
PWM0.hold_us(0)