UIFlow Guide
控制两个舵机通道来回转动0-180度
from m5stack import *
from m5ui import *
from uiflow import *
import time
import hat
setScreenColor(0x111111)
hat_cback_0 = hat.get(hat.CBACK)
while True:
hat_cback_0.set_servo_angle(0x00, 0)
hat_cback_0.set_servo_angle(0x01, 0)
wait(1)
hat_cback_0.set_servo_angle(0x00, 90)
hat_cback_0.set_servo_angle(0x01, 90)
wait(1)
hat_cback_0.set_servo_angle(0x00, 180)
hat_cback_0.set_servo_angle(0x01, 180)
wait(1)
hat_cback_0.set_servo_angle(0x00, 90)
hat_cback_0.set_servo_angle(0x01, 90)
wait(1)
wait_ms(2)
hat_cback_0.set_output(0)
hat_cback_0.get_adc16_raw()
hat_cback_0.set_output(0)
hat_cback_0.set_servo_angle(0x00, 0)
hat_cback_0.set_servo_pulse(0x10, 500)