UIFlow Guide
The car alternates between moving forward and backward, with the lights changing colors.
from m5stack import *
from m5ui import *
from uiflow import *
import time
import hat
setScreenColor(0x111111)
hat_bugc_0 = hat.get(hat.BUGC)
while True:
hat_bugc_0.SetAllRGB(0xff0000)
hat_bugc_0.SetPulse(0, 255)
hat_bugc_0.SetPulse(1, -255)
hat_bugc_0.SetPulse(2, 255)
hat_bugc_0.SetPulse(3, -255)
wait(5)
hat_bugc_0.SetAllRGB(0x00ff00)
hat_bugc_0.SetAllPulse(-255, 255, -255, 255)
wait(5)
wait_ms(2)
hat.get(hat.BUGC)
hat_bugc_0.SetRGB(0, 0xff0000)
hat_bugc_0.SetRGB(0, 0x000000)
hat_bugc_0.SetAllRGB(0x000000)
hat_bugc_0.SetAllPulse(0, 0, 0, 0)