UIFlow Guide
调节音量大小,并每隔一秒播放一个音调
from m5stack import *
from m5ui import *
from uiflow import *
import hat
import time
import hat
setScreenColor(0x111111)
hat_spk_0 = hat.get(hat.SPEAKER)
hat_spk_0.setVolume(1)
while True:
hat_spk_0.sing(220, 1)
wait(1)
hat_spk_0.sing(247, 1)
wait(1)
hat_spk_0.sing(247, 1)
wait(1)
wait_ms(2)
hat_spk_0.sing(220, 1)
hat_spk_0.tone(1800, 200)
hat_spk_0.setVolume(1)