UIFlow Guide
Loops to control the wheel speed and direction of RoverC, moving it in different directions with a 1-second delay.
from m5stack import *
from m5ui import *
from uiflow import *
import time
import hat
setScreenColor(0x111111)
hat_roverc_0 = hat.get(hat.ROVERC)
while True:
hat_roverc_0.SetAllPulse(20, 20, 20, 20)
wait(1)
hat_roverc_0.SetSpeed(0, (-20), 0)
wait(1)
hat_roverc_0.SetAllPulse(20, (-20), (-20), 20)
wait(1)
hat_roverc_0.SetSpeed((-20), 0, 0)
wait(1)
wait_ms(2)
hat_roverc_0.SetAllPulse(0, 0, 0, 0)
hat_roverc_0.SetPulse(0, 0)
hat_roverc_0.SetServoAngle(0, 0)
hat_roverc_0.SetServoPulse(0, 500)
hat_roverc_0.SetSpeed(0, 0, 0)