自强增加MIC音量方法

This commit is contained in:
dahanzimin
2025-02-13 17:28:54 +08:00
parent 62b9f6d80d
commit 05d4005563

View File

@@ -169,6 +169,14 @@ class LED:
onboard_led = LED(pins=[45, 46]) onboard_led = LED(pins=[45, 46])
class Voice_Energy:
def read(self):
_dat = onboard_asr._rreg(0x08, 3) #在语音识别里获取
print("-----",_dat)
return (_dat[0] | _dat[1] << 8) // 10
onboard_sound = Voice_Energy()
class Clock: class Clock:
def __init__(self, x, y, radius, color, oled=onboard_tft): #定义时钟中心点和半径 def __init__(self, x, y, radius, color, oled=onboard_tft): #定义时钟中心点和半径
self.display = oled self.display = oled