UIFlow Guide
小车左右旋转,前进,所有灯设置为绿色
from m5stack import *
from m5ui import *
from uiflow import *
import time
import hat
setScreenColor(0x111111)
hat_BeetleC_1 = hat.get(hat.BEETLEC)
hat_BeetleC_1.SetAllRGB(0x33ff33)
while True:
hat_BeetleC_1.SetPulse(0, 255)
hat_BeetleC_1.SetPulse(1, 0)
wait(1)
hat_BeetleC_1.SetPulse(0, 0)
hat_BeetleC_1.SetPulse(1, 255)
wait(1)
hat_BeetleC_1.SetPulse(0, 255)
hat_BeetleC_1.SetPulse(1, 255)
wait(1)
wait_ms(2)
hat_BeetleC_0.SetRGB(0, 0xff0000)
hat_BeetleC_0.SetAllRGB(0xff0000)
hat_BeetleC_0.SetPulse(0, 1)