build(boards): micropython板卡执行 npm run build:prod

This commit is contained in:
王立帮
2025-06-18 23:43:04 +08:00
parent e42a129714
commit 0d8b8b3170
61 changed files with 867 additions and 124 deletions

View File

@@ -156,9 +156,11 @@ class LED:
onboard_led = LED(onboard_bot.led_pwm)
class Voice_Energy:
def read(self):
_dat = onboard_asr._rreg(0x08, 3) #在语音识别里获取
return (_dat[0] | _dat[1] << 8) // 10
def read(self, samples=10):
values = []
for _ in range(samples):
values.append(int.from_bytes(onboard_asr._rreg(0x08, 3)[:2], 'little')) #在语音识别里获取
return sorted(values)[samples // 2]
onboard_sound = Voice_Energy()