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

This commit is contained in:
王立帮
2026-01-16 21:59:57 +08:00
parent bc2451005f
commit a7fdae500c
1123 changed files with 1171 additions and 1126 deletions

View File

@@ -30,6 +30,19 @@
"__size__": 4683,
"__name__": "sowl_bot.py"
},
"sowl_tts": {
"__require__": [
"gc",
"time",
"esp_tts",
"machine",
"pdm_i2s",
"mixgo_sowl"
],
"__file__": true,
"__size__": 821,
"__name__": "sowl_tts.py"
},
"st7735_cf": {
"__require__": [
"time",
@@ -46,7 +59,7 @@
"time"
],
"__file__": true,
"__size__": 1955,
"__size__": 1990,
"__name__": "ws2812x.py"
}
}

View File

@@ -83,7 +83,7 @@ except Exception as e:
print("Warning: Failed to communicate with CI1316XP (ASR) or", e)
'''2RGB_WS2812'''
onboard_rgb = NeoPixel(onboard_bot.rgb_sync, 3)
onboard_rgb = NeoPixel(onboard_bot.rgb_sync, 2)
'''1Buzzer-Music'''
onboard_music = MIDI(0, pa_ctrl=onboard_asr.pa_ctrl)

View File

@@ -0,0 +1,32 @@
"""
SOWL-TTS
MicroPython library for the SOWL-TTS(暂行)
=======================================================
@dahanzimin From the Mixly Team
"""
import gc,time
from esp_tts import TTS
from machine import Pin
from pdm_i2s import PDMTX
from mixgo_sowl import onboard_asr
audio = PDMTX(dout_pin=Pin(0), sample_rate=16000, buffer_size=1024)
tts = TTS()
def play(text, speed=3):
try:
onboard_asr.pa_ctrl(1, 100)
if tts.parse_chinese(text):
audio.start()
while True:
data = tts.stream_play(speed)
if not data:
break
else:
xx= audio.write(data)
#time.sleep(0.2)
finally:
onboard_asr.pa_ctrl(0)
audio.stop()
gc.collect()

View File

@@ -8,12 +8,12 @@ Micropython library for the WS2812 NeoPixel-RGB(method inheritance)
from time import sleep
class NeoPixel:
def __init__(self, func, n, bpp=3, ORDER=(0, 1, 2, 3)):
def __init__(self, func, n, bpp=3, ORDER=(0, 1, 2, 3), status=(0, 10 ,0)):
self.func = func
self.bpp = bpp
self.rgbs = n
self.ORDER = ORDER
self.rgb_buf = bytearray(self.rgbs * bpp)
self.rgb_buf = bytearray(self.rgbs * bpp) + bytes(status)
self.write()
def __len__(self):