feat: sync all micropython board configurations and scripts

This commit is contained in:
yczpf2019
2026-01-24 16:14:43 +08:00
parent c6dc5537f0
commit 6dce82e125
2066 changed files with 113326 additions and 0 deletions

View File

@@ -0,0 +1,117 @@
"""
Camera
MicroPython library for the Camera(Inherit C module)
=======================================================
@dahanzimin From the Mixly Team
"""
import time, gc
import urequests
from _camera import *
from base64 import b64encode
from machine import SoftI2C, Pin
from jpeg import Encoder, Decoder
class IMG:
def __init__(self, image, width, height):
self.image = image
self.width = width
self.height = height
self.format = "RGB565"
class Camera(Camera):
def __init__(self, frame_size=FrameSize.R240X240, pixel_format=PixelFormat.RGB565, skip_frame=3, hmirror=False, vflip=False, **kwargs):
from mixgo_sant import onboard_bot
onboard_bot.cam_reset(1, 0)
onboard_bot.cam_en(1, 150)
super().__init__(frame_size=frame_size, pixel_format=pixel_format, **kwargs)
self.set_hmirror(not hmirror)
time.sleep_ms(150)
self.set_vflip(not vflip)
SoftI2C(scl=Pin(47), sda=Pin(48), freq=400000) # 恢复I2C
for _ in range(skip_frame):
super().capture()
def deinit(self):
super().deinit()
gc.collect()
onboard_bot.cam_reset(0, 0)
onboard_bot.cam_en(0, 100)
def snapshot(self, path=None, quality=90, rotation=0):
if path is None:
return self.capture()
else:
Image.save(self.capture(), path, quality=quality, rotation=rotation)
def capture(self):
return IMG(super().capture(), self.get_pixel_width(), self.get_pixel_height())
class Image:
def save(self, img, path="mixly.jpg", **kwargs):
'''quality(1-100), rotation (0, 90, 180, 270)'''
_encoder = Encoder(pixel_format="RGB565_BE", width=img.width, height=img.height, **kwargs)
_jpeg = _encoder.encode(img.image)
del _encoder
gc.collect()
if isinstance(path, str):
with open(path, 'wb') as f:
f.write(_jpeg)
else:
return _jpeg
def open(self, path="mixly.jpg", scale_width=None, scale_height=None, tft_width=240, tft_height=240, **kwargs):
'''rotation (0, 90, 180, 270), clipper_width, clipper_height'''
with open(path, "rb") as f:
_jpeg = f.read()
return self._jpg_decoder(_jpeg, scale_width, scale_height, tft_width, tft_height, **kwargs)
def convert(self, img, formats=0, **kwargs):
if formats == 0:
return self.save(img, None, **kwargs)
elif formats == 1:
return b'data:image/jpg;base64,' + b64encode(self.save(img, None, **kwargs))
def download(self, url, path=None, scale_width=None, scale_height=None, tft_width=240, tft_height=240, block=1024, **kwargs):
'''rotation (0, 90, 180, 270), clipper_width, clipper_height'''
response = urequests.get(url, stream=True)
if path is None:
_image = self._jpg_decoder(response.raw.read(), scale_width, scale_height, tft_width, tft_height, **kwargs)
response.close()
return _image
else:
with open(path, 'wb') as f:
while True:
_data = response.raw.read(block)
if not _data:
break
else:
f.write(_data)
response.close()
def _jpg_decoder(self, jpg, scale_width, scale_height, tft_width, tft_height, **kwargs):
'''Automatically zoom based on the screen'''
if scale_width is None or scale_height is None:
_width = tft_width
_height = tft_height
for i in range(min(len(jpg), 1024)):
if jpg[i] == 0xFF and (jpg[i + 1] & 0xF0) == 0xC0:
if jpg[i + 1] not in [0xC4, 0xC8, 0xCC]:
_width = jpg[i + 7] << 8 | jpg[i + 8]
_height = jpg[i + 5] << 8| jpg[i + 6]
break
if _width > tft_width or _height > tft_height:
_scale = max(_width / tft_width, _height / tft_height) * 8
_decoder = Decoder(pixel_format="RGB565_BE", scale_width=round(_width / _scale) * 8, scale_height=round(_height / _scale) * 8, **kwargs)
else:
_decoder = Decoder(pixel_format="RGB565_BE", **kwargs)
else:
_decoder = Decoder(pixel_format="RGB565_BE", scale_width=scale_width // 8 * 8, scale_height=scale_height // 8 * 8, **kwargs)
_info = _decoder.get_img_info(jpg)
_image = IMG(_decoder.decode(jpg), _info[0], _info[1])
del _decoder, jpg
gc.collect()
return _image
#图像处理
Image = Image()

View File

@@ -0,0 +1,32 @@
"""
CI1302(继承ci130x)
MicroPython library for the CI130Xx (ASR-I2C)
=======================================================
@dahanzimin From the Mixly Team
"""
from ci130x import CI130X
class CI1302(CI130X):
def __init__(self, i2c_bus, func, addr=0x64):
self._device = i2c_bus
self._address = addr
self._cmd_id = None
self._func = func
def _wreg(self, reg):
'''Write memory address'''
try:
self._device.writeto(self._address, reg)
except:
self._func(1, 700) # Power on
self._device.writeto(self._address, reg)
def _rreg(self, reg, nbytes=1):
'''Read memory address'''
try:
return self._device.readfrom_mem(self._address, reg, nbytes)
except:
self._func(1, 700) # Power on
return self._device.readfrom_mem(self._address, reg, nbytes)

View File

@@ -0,0 +1,195 @@
# -*- coding: UTF-8 -*-
import time
from micropython import const
_ES_MODULE_ADC = const(0x01)
_ES_MODULE_DAC = const(0x02)
_ES_MODULE_ADC_DAC = const(0x03)
_ES_MODULE_LINE = const(0x04)
_BIT_LENGTH_16BITS = const(0x03)
_FMT_I2S_NORMAL = const(0x00)
_I2S_MODE_SLAVE = const(0x00)
_ADC_INPUT_LINE = const(0x01)
_DAC_OUTPUT_ALL = const(0x02)
_LCLK_DIV = const(256)
_MCLK_DIV = const(0x04)
class ES8374:
def __init__(self, i2c_bus=None, i2c_addr=0x10, gain=5, pga_en=1):
self.i2c_bus = i2c_bus
self.i2c_addr = i2c_addr
self.stop()
self.init_reg(_I2S_MODE_SLAVE, ((_BIT_LENGTH_16BITS << 4) | _FMT_I2S_NORMAL), _DAC_OUTPUT_ALL, _ADC_INPUT_LINE)
self.mic_gain(gain)
self.pga_enable(pga_en)
self.configI2SFormat(_ES_MODULE_ADC_DAC, _FMT_I2S_NORMAL)
def _readReg(self, regAddr):
return self.i2c_bus.readfrom_mem(self.i2c_addr, regAddr, 1)[0]
def _writeReg(self, regAddr, data):
self.i2c_bus.writeto_mem(
self.i2c_addr, regAddr, data.to_bytes(1, 'little'))
def init_reg(self, ms_mode, fmt, out_channel, in_channel):
self._writeReg(0x00, 0x3F) # IC Rst start
self._writeReg(0x00, 0x03) # IC Rst stop
self._writeReg(0x01, 0x7F) # IC clk on # M ORG 7F
self._writeReg(0x0f, (self._readReg(0x0F) & 0x7f) | (ms_mode << 7)) # CODEC IN I2S SLAVE MODE
self._writeReg(0x6F, 0xA0) # pll set:mode enable
self._writeReg(0x72, 0x41) # pll set:mode set
self._writeReg(0x09, 0x01) # pll set:reset on ,set start
self._writeReg(0x0C, 0x22) # pll set:k
self._writeReg(0x0D, 0x2E) # pll set:k
self._writeReg(0x0E, 0xC6) # pll set:k
self._writeReg(0x0A, 0x3A) # pll set:
self._writeReg(0x0B, 0x07) # pll set:n
self._writeReg(0x09, 0x41) # pll set:reset off ,set stop
self.i2sConfigClock()
self._writeReg(0x24, 0x08) # adc set
self._writeReg(0x36, 0x00) # dac set
self._writeReg(0x12, 0x30) # timming set
self._writeReg(0x13, 0x20) # timming set
self.configI2SFormat(_ES_MODULE_ADC, fmt)
self.configI2SFormat(_ES_MODULE_DAC, fmt)
self._writeReg(0x21, 0x50) # adc set: SEL LIN1 CH+PGAGAIN=0DB
self._writeReg(0x22, 0xFF) # adc set: PGA GAIN=0DB
self._writeReg(0x21, 0x14) # adc set: SEL LIN1 CH+PGAGAIN=18DB
self._writeReg(0x22, 0x55) # pga = +15db
# set class d divider = 33, to avoid the high frequency tone on laudspeaker
self._writeReg(0x08, 0x21)
self._writeReg(0x00, 0x80) # IC START
time.sleep(0.05)
self._writeReg(0x25, 0x00) # ADCVOLUME on
self._writeReg(0x38, 0x00) # DACVOLUME on
self._writeReg(0x14, 0x8A) # IC START
self._writeReg(0x15, 0x40) # IC START
self._writeReg(0x1A, 0xA0) # monoout set
self._writeReg(0x1B, 0x19) # monoout set
self._writeReg(0x1C, 0x90) # spk set
self._writeReg(0x1D, 0x01) # spk set
self._writeReg(0x1F, 0x00) # spk set
self._writeReg(0x1E, 0x20) # spk on
self._writeReg(0x28, 0x70) # alc set 0x70
# self._writeReg(0x26, 0x4E)# alc set
# self._writeReg(0x27, 0x10)# alc set
# self._writeReg(0x29, 0x00)# alc set
# self._writeReg(0x2B, 0x00)# alc set
self._writeReg(0x25, 0x00) # ADCVOLUME on
self._writeReg(0x38, 0x00) # DACVOLUME on
self._writeReg(0x37, 0x30) # dac set
# SEL:GPIO1=DMIC CLK OUT+SEL:GPIO2=PLL CLK OUT
self._writeReg(0x6D, 0x60)
self._writeReg(0x71, 0x05) # for automute setting
self._writeReg(0x73, 0x70)
# 0x3c Enable DAC and Enable Lout/Rout/1/2
self.configDACOutput(out_channel)
# 0x00 LINSEL & RINSEL, LIN1/RIN1 as ADC Input DSSEL,use one DS Reg11 DSR, LINPUT1-RINPUT1
self.configADCInput(in_channel)
self.voice_volume(95)
self._writeReg(0x37, 0x00) # dac set
'''
reg = self._readReg(0x1a) # disable lout
reg |= 0x08
self._writeReg(0x1a, reg)
reg &= 0xdf
self._writeReg(0x1a, reg)
self._writeReg(0x1D, 0x12) # mute speaker
self._writeReg(0x1E, 0x20) # disable class d
reg = self._readReg(0x15) # power up dac
reg &= 0xdf
self._writeReg(0x15, reg)
reg = self._readReg(0x1a) # disable lout
reg |= 0x20
self._writeReg(0x1a, reg)
reg &= 0xf7
self._writeReg(0x1a, reg)
self._writeReg(0x1D, 0x02) # mute speaker
self._writeReg(0x1E, 0xa0) # disable class d
self.voice_mute(0)
'''
def stop(self):
self.voice_mute(1)
self._writeReg(0x1a, self._readReg(0x1a) | 0x08)
self._writeReg(0x1a, self._readReg(0x1a) & 0xdf)
self._writeReg(0x1D, 0x12) # mute speaker
self._writeReg(0x1E, 0x20) # disable class d
self._writeReg(0x15, self._readReg(0x15) | 0x20)
self._writeReg(0x10, self._readReg(0x10) | 0xc0)
self._writeReg(0x21, self._readReg(0x21) | 0xc0)
def i2sConfigClock(self):
self._writeReg(0x0f, (self._readReg(0x0F) & 0xe0) | _MCLK_DIV)
# ADCFsMode,singel SPEED,RATIO=256
self._writeReg(0x06, _LCLK_DIV >> 8)
# ADCFsMode,singel SPEED,RATIO=256
self._writeReg(0x07, _LCLK_DIV & 0xFF)
def configI2SFormat(self, mode, fmt):
fmt_tmp = ((fmt & 0xf0) >> 4)
fmt_i2s = fmt & 0x0f
if (mode == _ES_MODULE_ADC or mode == _ES_MODULE_ADC_DAC):
reg = self._readReg(0x10)
reg &= 0xfc
self._writeReg(0x10, (reg | fmt_i2s))
self.setBitsPerSample(mode, 3)
if (mode == _ES_MODULE_DAC or mode == _ES_MODULE_ADC_DAC):
reg = self._readReg(0x11)
reg &= 0xfc
self._writeReg(0x11, (reg | fmt_i2s))
self.setBitsPerSample(mode, 3)
# set Bits Per Sample
def setBitsPerSample(self, mode, bit_per_smaple):
bits = bit_per_smaple & 0x0f
if (mode == _ES_MODULE_ADC or mode == _ES_MODULE_ADC_DAC):
reg = self._readReg(0x10)
reg &= 0xe3
self._writeReg(0x10, (reg | (bits << 2)))
if (mode == _ES_MODULE_DAC or mode == _ES_MODULE_ADC_DAC):
reg = self._readReg(0x11)
reg &= 0xe3
self._writeReg(0x11, (reg | (bits << 2)))
def configDACOutput(self, output):
self._writeReg(0x1d, 0x02)
reg = self._readReg(0x1c) # set spk mixer
reg |= 0x80
self._writeReg(0x1c, reg)
self._writeReg(0x1D, 0x02) # spk set
self._writeReg(0x1F, 0x00) # spk set
self._writeReg(0x1E, 0xA0) # spk on
def configADCInput(self, input):
reg = self._readReg(0x21)
reg = (reg & 0xcf) | 0x24
self._writeReg(0x21, reg)
def mic_volume(self, volume=None):
if volume is None:
return round(100 - self._readReg(0x25) * 100 / 192)
else:
self._writeReg(0x25, (100 - volume) * 192 // 100)
def voice_volume(self, volume=None):
if volume is None:
return round(100 - self._readReg(0x38) * 100 / 192)
else:
self._writeReg(0x38, (100 - volume) * 192 // 100)
def voice_mute(self, enable=None):
if enable is None:
return True if self._readReg(0x36) & 0x40 else False
else:
self._writeReg(0x36, (self._readReg(0x36) & 0xdf) | (enable << 5))
def mic_gain(self, gain):
gain_n = max(min(gain, 15), 0)
self._writeReg(0x22, (gain_n | (gain_n << 4))) # MIC PGA -3.5db ~ 24db
def pga_enable(self, enable):
self._writeReg(0x21, (self._readReg(0x21) & 0xfb) | (enable << 2)) # MIC PGA 0db or 15db

View File

@@ -0,0 +1,62 @@
"""
ESP-DL
MicroPython library for the ESP-DL(Inherit C module)
=======================================================
@dahanzimin From the Mixly Team
"""
from espdl import *
def analyze(results, keys=None, num=0):
if keys is None:
return True if results else False
if results:
if keys == "len":
return len(results)
else:
return results[num][keys]
#简单处理模型运行结果
_onboard_tft = None
def simple_run(molde, camera, keys="len", keyx=None, num=0, color=0xF800, size=2, sync=True):
global _onboard_tft
if _onboard_tft is None:
from mixgo_sant import onboard_tft
_onboard_tft = onboard_tft
if sync: _onboard_tft.fill(0, sync=False)
_img = camera.capture()
_onboard_tft.display(_img, sync=False)
_result = molde.run(_img.image)
_data = None
if _result:
_x_of = (camera.get_pixel_width() - _onboard_tft.width) // 2
_y_of = (camera.get_pixel_height() - _onboard_tft.height) // 2
for r in _result:
x = 0
y = 0
if r['box']:
_onboard_tft.rect(r['box'][0] - _x_of, r['box'][1] - _y_of, r['box'][2], r['box'][3], color, sync=False)
x = r['box'][0]
y = r['box'][1] + r['box'][3]
if "person" in r:
_onboard_tft.shows(r['person']['name'], x=x - _x_of, y=y - _y_of, size=size, center=0, color=color, sync=False)
else:
if r['box']:
_onboard_tft.shows(r['data'], x=x - _x_of, y=y - _y_of, size=size, center=0, color=color, sync=False)
else:
_onboard_tft.shows(r['data'], y=0, size=size, center=True, color=color, sync=False)
break
if keys == "len":
_data = len(_result)
else:
_data = _result[num][keys] if keyx is None else _result[num][keys][keyx]
if sync: _onboard_tft.show()
return _data

View File

@@ -0,0 +1,234 @@
{
"camera": {
"__require__": [
"time",
"gc",
"urequests",
"_camera",
"base64",
"machine",
"jpeg",
"mixgo_sant"
],
"__file__": true,
"__size__": 4782,
"__name__": "camera.py"
},
"ci1302x": {
"__require__": [
"ci130x"
],
"__file__": true,
"__size__": 939,
"__name__": "ci1302x.py"
},
"es8374": {
"__require__": [
"time",
"micropython"
],
"__file__": true,
"__size__": 8066,
"__name__": "es8374.py"
},
"esp_dl": {
"__require__": [
"espdl",
"mixgo_sant"
],
"__file__": true,
"__size__": 2060,
"__name__": "esp_dl.py"
},
"mixgo_nova": {
"__require__": [
"ws2812",
"machine",
"time",
"gc",
"st7735",
"math",
"_boot",
"mxc6655xa",
"ltr553als",
"ltr553als",
"rc522",
"mmc5603",
"hp203x",
"ahtx0",
"shtc3",
"machine"
],
"__file__": true,
"__size__": 10416,
"__name__": "mixgo_nova.py"
},
"mixgo_nova_voice": {
"__require__": [
"es8374",
"ustruct",
"music_spk",
"machine",
"esp_i2s",
"esp_tts",
"mixgo_nova",
"urequests"
],
"__file__": true,
"__size__": 2804,
"__name__": "mixgo_nova_voice.py"
},
"mixgo_sant": {
"__require__": [
"gc",
"time",
"math",
"machine",
"music",
"ws2812x",
"st7789_cf",
"sant_bot",
"sc7a20",
"ltr553als",
"shtc3",
"mmc5603",
"ci1302x"
],
"__file__": true,
"__size__": 7375,
"__name__": "mixgo_sant.py"
},
"mixgo_soar": {
"__require__": [
"ws2812",
"machine",
"time",
"gc",
"math",
"st7789_bf",
"soar_bot",
"spl06_001",
"qmi8658",
"ltr553als",
"mmc5603"
],
"__file__": true,
"__size__": 6752,
"__name__": "mixgo_soar.py"
},
"mixgo_soar_voice": {
"__require__": [
"es8374",
"ustruct",
"music_spk",
"machine",
"esp_i2s",
"esp_tts",
"mixgo_soar",
"urequests"
],
"__file__": true,
"__size__": 2804,
"__name__": "mixgo_soar_voice.py"
},
"music_spk": {
"__require__": [
"time",
"math",
"struct"
],
"__file__": true,
"__size__": 7981,
"__name__": "music_spk.py"
},
"nova_g1": {
"__require__": [
"micropython",
"mixgo_nova"
],
"__file__": true,
"__size__": 3860,
"__name__": "nova_g1.py"
},
"sant_bot": {
"__require__": [
"time",
"micropython"
],
"__file__": true,
"__size__": 5064,
"__name__": "sant_bot.py"
},
"sant_g2": {
"__require__": [
"gc",
"machine",
"rc522",
"cbr817"
],
"__file__": true,
"__size__": 729,
"__name__": "sant_g2.py"
},
"sant_gx": {
"__require__": [
"gc",
"machine",
"rc522",
"cbr817"
],
"__file__": true,
"__size__": 731,
"__name__": "sant_gx.py"
},
"sant_tts": {
"__require__": [
"gc",
"esp_tts",
"machine",
"pwm_audio",
"mixgo_sant"
],
"__file__": true,
"__size__": 747,
"__name__": "sant_tts.py"
},
"soar_bot": {
"__require__": [
"time",
"micropython"
],
"__file__": true,
"__size__": 4048,
"__name__": "soar_bot.py"
},
"st7789_bf": {
"__require__": [
"time",
"uframebuf",
"machine"
],
"__file__": true,
"__size__": 3711,
"__name__": "st7789_bf.py"
},
"st7789_cf": {
"__require__": [
"time",
"uframebuf",
"machine",
"camera"
],
"__file__": true,
"__size__": 3595,
"__name__": "st7789_cf.py"
},
"ws2812x": {
"__require__": [
"time"
],
"__file__": true,
"__size__": 1957,
"__name__": "ws2812x.py"
}
}

View File

@@ -0,0 +1,355 @@
"""
mixgo_zero Zi Onboard resources
Micropython library for the mixgo_zero Zi Onboard resources
=======================================================
#Preliminary composition 20231020
#S3定时器ID(-1,0,1,2,3(led))
dahanzimin From the Mixly Team
"""
from ws2812 import NeoPixel
from machine import *
import time
import gc
import st7735
import math
'''RTC'''
rtc_clock = RTC()
'''I2C-onboard'''
version = not Pin(13, Pin.IN, Pin.PULL_DOWN).value()
onboard_i2c = SoftI2C(scl=Pin(36), sda=Pin(37), freq=400000)
onboard_i2c_soft = SoftI2C(scl=Pin(36) if version else Pin(13), sda=Pin(15), freq=400000)
onboard_i2c_scan = onboard_i2c.scan()
'''SPI-onboard'''
try:
import _boot
onboard_spi = _boot.onboard_spi
onboard_spi.init(baudrate=50000000)
except:
onboard_spi = SPI(1, baudrate=50000000, polarity=0, phase=0)
'''TFT/128*160'''
onboard_tft = st7735.ST7735(
onboard_spi, 160, 128, dc_pin=18, cs_pin=45, bl_pin=14, font_address=0x700000)
'''ACC-Sensor'''
try:
import mxc6655xa
onboard_acc = mxc6655xa.MXC6655XA(onboard_i2c, front=True)
except Exception as e:
print("Warning: Failed to communicate with MXC6655XA (ACC) or", e)
'''ALS_PS-Sensor *2'''
try:
import ltr553als
onboard_als_l = ltr553als.LTR_553ALS(onboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with TR_553ALS (ALS&PS) or", e)
try:
import ltr553als
onboard_als_r = ltr553als.LTR_553ALS(onboard_i2c_soft)
except Exception as e:
print("Warning: Failed to communicate with TR_553ALS (ALS&PS) or", e)
'''BPS-Sensor'''
if 0x76 in onboard_i2c_scan:
try:
import hp203x
onboard_bps = hp203x.HP203X(onboard_i2c_soft)
except Exception as e:
print("Warning: Failed to communicate with HP203X (BPS) or", e)
'''THS-Sensor'''
if 0x38 in onboard_i2c_scan:
try:
import ahtx0
onboard_ths = ahtx0.AHTx0(onboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with AHTx0 (THS) or", e)
if 0x70 in onboard_i2c_scan:
try:
import shtc3
onboard_ths = shtc3.SHTC3(onboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with GXHTC3 (THS) or", e)
'''RFID-Sensor'''
try:
import rc522
onboard_rfid = rc522.RC522(onboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with RC522 (RFID) or", e)
'''MGS-Sensor'''
try:
import mmc5603
onboard_mgs = mmc5603.MMC5603(onboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with MMC5603 (MGS) or", e)
'''2RGB_WS2812'''
onboard_rgb = NeoPixel(Pin(38), 4)
'''5KEY_Sensor'''
class KEYSensor:
def __init__(self, pin, range):
self.pin = pin
self.adc = ADC(Pin(pin), atten=ADC.ATTN_0DB)
self.range = range
self.flag = True
def _value(self):
values = []
for _ in range(50):
values.append(self.adc.read())
time.sleep_us(2)
return (self.range-200) < min(values) < (self.range+200)
def get_presses(self, delay=1):
last_time, presses = time.time(), 0
while time.time() < last_time + delay:
time.sleep_ms(50)
if self.was_pressed():
presses += 1
return presses
def is_pressed(self):
return self._value()
def was_pressed(self):
if (self._value() != self.flag):
self.flag = self._value()
if self.flag:
return True
else:
return False
def irq(self, handler, trigger):
Pin(self.pin, Pin.IN).irq(handler=handler, trigger=trigger)
'''1KEY_Button'''
class Button(KEYSensor):
def __init__(self, pin):
self.pin = pin
self.key = Pin(pin, Pin.IN)
self.flag = True
def _value(self):
return not self.key.value()
B1key = Button(0)
B2key = KEYSensor(17, 0)
A1key = KEYSensor(17, 2900)
A2key = KEYSensor(17, 2300)
A3key = KEYSensor(17, 1650)
A4key = KEYSensor(17, 850)
'''2-TouchPad'''
class Touch_Pad:
__species = {}
__first_init = True
def __new__(cls, pin, *args, **kwargs):
if pin not in cls.__species.keys():
cls.__first_init = True
cls.__species[pin] = object.__new__(cls)
return cls.__species[pin]
def __init__(self, pin, default=30000):
if self.__first_init:
self.__first_init = False
from machine import TouchPad
self._pin = TouchPad(Pin(pin))
self.raw = self._pin.read()
if self.raw >= default * 1.5:
self.raw = default
def touch(self, value=None):
return self._pin.read() > value if value else self._pin.read()
# Touch with function call
def touched(pin, value=60000):
return Touch_Pad(pin).touch(value)
def touch_slide(pina, pinb):
return ((Touch_Pad(pina).touch() - Touch_Pad(pina).raw) - (Touch_Pad(pinb).touch() - Touch_Pad(pinb).raw)) // 10
'''2LED-Tristate'''
class LED_T:
def __init__(self, pin, timer_id=3):
self._pin = pin
self._pwm = 0
self._index_pwm = [0, 0]
Timer(timer_id, freq=2500, mode=Timer.PERIODIC, callback=self.tim_callback)
def _cutonoff(self, val):
if val == 0:
Pin(self._pin, Pin.IN)
elif val == 1:
Pin(self._pin, Pin.OUT).value(1)
elif val == -1:
Pin(self._pin, Pin.OUT).value(0)
def tim_callback(self, tim):
if self._pwm <= 25:
if self._pwm * 4 < self._index_pwm[0]:
self._cutonoff(1)
else:
self._cutonoff(0)
else:
if (self._pwm - 26) * 4 < self._index_pwm[1]:
self._cutonoff(-1)
else:
self._cutonoff(0)
self._pwm = self._pwm + 1 if self._pwm <= 51 else 0
def setbrightness(self, index, val):
if not 0 <= val <= 100:
raise ValueError("Brightness must be in the range: 0~100%")
self._index_pwm[index-1] = val
def getbrightness(self, index):
return self._index_pwm[index-1]
def setonoff(self, index, val):
if (val == -1):
if self._index_pwm[index-1] < 50:
self._index_pwm[index-1] = 100
else:
self._index_pwm[index-1] = 0
elif (val == 1):
self._index_pwm[index-1] = 100
elif (val == 0):
self._index_pwm[index-1] = 0
def getonoff(self, index):
return True if self._index_pwm[index-1] > 0 else False
'''2LED-Independent'''
class LED_I:
def __init__(self, pins=[]):
self._pins = [PWM(Pin(pin), duty_u16=0) for pin in pins]
self._brightness = [0 for _ in range(len(self._pins))]
def setbrightness(self, index, val):
if not 0 <= val <= 100:
raise ValueError("Brightness must be in the range: 0-100%")
self._brightness[index - 1] = val
self._pins[index - 1].duty_u16(val * 65535 // 100)
def getbrightness(self, index):
return self._brightness[index - 1]
def setonoff(self, index, val):
if val == -1:
self.setbrightness(index, 100) if self.getbrightness(
index) < 50 else self.setbrightness(index, 0)
elif val == 1:
self.setbrightness(index, 100)
elif val == 0:
self.setbrightness(index, 0)
def getonoff(self, index):
return True if self.getbrightness(index) > 50 else False
onboard_led = LED_I(pins=[42, 13]) if version else LED_T(42, timer_id=3)
class Clock:
def __init__(self, x, y, radius, color, oled=onboard_tft): # 定义时钟中心点和半径
self.display = oled
self.xc = x
self.yc = y
self.r = radius
self.color = color
self.hour = 0
self.min = 0
self.sec = 0
def set_time(self, h, m, s): # 设定时间
self.hour = h
self.min = m
self.sec = s
def set_rtctime(self): # 设定时间
t = rtc_clock.datetime()
self.hour = t[4]
self.min = t[5]
self.sec = t[6]
def drawDial(self, color): # 画钟表刻度
r_tic1 = self.r - 1
r_tic2 = self.r - 2
self.display.ellipse(self.xc, self.yc, self.r, self.r, self.color)
self.display.ellipse(self.xc, self.yc, 2, 2, self.color, True)
for h in range(12):
at = math.pi * 2.0 * h / 12.0
x1 = round(self.xc + r_tic1 * math.sin(at))
x2 = round(self.xc + r_tic2 * math.sin(at))
y1 = round(self.yc - r_tic1 * math.cos(at))
y2 = round(self.yc - r_tic2 * math.cos(at))
self.display.line(x1, y1, x2, y2, color)
def drawHour(self, color): # 画时针
r_hour = int(self.r / 10.0 * 5)
ah = math.pi * 2.0 * ((self.hour % 12) + self.min / 60.0) / 12.0
xh = int(self.xc + r_hour * math.sin(ah))
yh = int(self.yc - r_hour * math.cos(ah))
self.display.line(self.xc, self.yc, xh, yh, color)
def drawMin(self, color): # 画分针
r_min = int(self.r / 10.0 * 7)
am = math.pi * 2.0 * self.min / 60.0
xm = round(self.xc + r_min * math.sin(am))
ym = round(self.yc - r_min * math.cos(am))
self.display.line(self.xc, self.yc, xm, ym, color)
def drawSec(self, color): # 画秒针
r_sec = int(self.r / 10.0 * 9)
asec = math.pi * 2.0 * self.sec / 60.0
xs = round(self.xc + r_sec * math.sin(asec))
ys = round(self.yc - r_sec * math.cos(asec))
self.display.line(self.xc, self.yc, xs, ys, color)
def draw_clock(self): # 画完整钟表
self.drawDial(self.color)
self.drawHour(self.color)
self.drawMin(self.color)
self.drawSec(self.color)
self.display.show()
self.clear(0)
def clear(self, color=0): # 清除
self.drawHour(color)
self.drawMin(color)
self.drawSec(color)
'''Reclaim memory'''
gc.collect()

View File

@@ -0,0 +1,93 @@
"""
mixgo_nova Voice Onboard resources
Micropython library for the mixgo_nova Onboard resources
=======================================================
@dahanzimin From the Mixly Team
"""
import es8374
import ustruct
import music_spk
from machine import Pin
from esp_i2s import I2S
from esp_tts import TTS
from mixgo_nova import onboard_i2c
ob_code = es8374.ES8374(onboard_i2c)
ob_tts = TTS()
ob_audio = I2S(0, sck=Pin(34), ws=Pin(47), sd_out=Pin(48), sd_in=Pin(33), mck=Pin(35), channels=1)
ob_audio.start()
spk_midi = music_spk.MIDI(ob_audio)
def u2s(n):
return n if n < (1 << 15) else n - (1 << 16)
def sound_level():
buf = bytearray(100)
values = []
ob_audio.readinto(buf)
for i in range(len(buf)//2):
values.append(u2s(buf[i * 2] | buf[i * 2 + 1] << 8))
return max(values) - min(values)
def play_tts(text, speed=3):
ob_audio.stop()
ob_audio.sample_rate = 16000
ob_audio.start()
if ob_tts.parse_chinese(text):
while True:
data = ob_tts.stream_play(speed)
if not data:
break
else:
ob_audio.write(data)
def play_audio(path, chunk=1024):
file = open(path, 'rb')
header = file.read(44)
if header[8:12] != b'WAVE':
raise Error('not a WAVE file')
ob_audio.stop()
ob_audio.sample_rate = ustruct.unpack('<I', header[24:28])[0]
ob_audio.start()
file.seek(44)
while True:
block = file.read(chunk)
if not block:
break
ob_audio.write(block)
file.close()
def record_audio(path, seconds=5, sample_rate=22050, chunk=512):
ob_audio.stop()
ob_audio.sample_rate = sample_rate
ob_audio.start()
file_size = sample_rate * 16 * 1 * seconds // 8
wav_header = bytearray(44)
wav_header[0:4] = b'RIFF'
ustruct.pack_into('<I', wav_header, 4, file_size + 36)
wav_header[8:40] = b'WAVEfmt \x10\x00\x00\x00\x01\x00\x01\x00"V\x00\x00D\xac\x00\x00\x02\x00\x10\x00data'
ustruct.pack_into('<I', wav_header, 40, file_size)
buf = bytearray(chunk)
file = open(path, 'wb')
file.write(wav_header)
for _ in range(file_size // chunk):
ob_audio.readinto(buf)
file.write(buf)
file.close()
def play_audio_url(url, chunk=1024):
import urequests
response = urequests.get(url, stream=True)
header = response.raw.read(44)
if header[8:12] != b'WAVE':
raise Error('not a WAVE file')
ob_audio.stop()
ob_audio.sample_rate = ustruct.unpack('<I', header[24:28])[0]
ob_audio.start()
while True:
block = response.raw.read(chunk)
if not block:
break
ob_audio.write(block)
response.close()

View File

@@ -0,0 +1,245 @@
"""
mixgo_sant Onboard resources(v2.0)
Micropython library for the mixgo_sant Onboard resources
=======================================================
@dahanzimin From the Mixly Team
"""
import gc
import time
import math
from machine import *
from music import MIDI
from ws2812x import NeoPixel
'''RTC'''
rtc_clock = RTC()
'''I2C-onboard'''
# inboard_i2c = I2C(0)
inboard_i2c = SoftI2C(scl=Pin(47), sda=Pin(48), freq=400000)
onboard_i2c = SoftI2C(scl=Pin(47), sda=Pin(38), freq=400000)
'''SPI-onboard'''
onboard_spi = SPI(1, baudrate=80000000, polarity=1, phase=1)
'''BOT035-Sensor'''
try:
import sant_bot
onboard_bot = sant_bot.BOT035(inboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with BOT035 (Coprocessor) or", e)
'''TFT/240*240'''
import st7789_cf
onboard_tft = st7789_cf.ST7789(onboard_spi, 240, 240, dc_pin=45, reset=onboard_bot.tft_reset, backlight=onboard_bot.tft_brightness, font_address=0xF00000)
'''ACC-Sensor'''
try:
import sc7a20
onboard_acc = sc7a20.SC7A20(inboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with SC7A20H (ACC) or", e)
'''ALS_PS-Sensor *2'''
try:
import ltr553als
onboard_als_l = ltr553als.LTR_553ALS(onboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with TR_553ALS-L (ALS&PS) or", e)
try:
# import ltr553als
onboard_als_r = ltr553als.LTR_553ALS(inboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with TR_553ALS-R (ALS&PS) or", e)
'''THS-Sensor'''
try:
import shtc3
onboard_ths = shtc3.SHTC3(inboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with GXHTC3 (THS) or", e)
'''MGS-Sensor'''
try:
import mmc5603
onboard_mgs = mmc5603.MMC5603(inboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with MMC5603 (MGS) or", e)
'''ASR-Sensor'''
try:
from ci1302x import CI1302
onboard_asr = CI1302(inboard_i2c, onboard_bot.asr_en)
except Exception as e:
print("Warning: Failed to communicate with CI130X (ASR) or", e)
'''2RGB_WS2812'''
onboard_rgb = NeoPixel(onboard_bot.rgb_sync, 4)
'''1Buzzer-Music'''
onboard_music = MIDI(46, pa_ctrl=onboard_bot.spk_en)
'''5KEY_Sensor'''
class KEYSensor:
def __init__(self, pin, range):
self.pin = pin
self.adc = ADC(Pin(pin))
self.adc.atten(ADC.ATTN_0DB)
self.range = range
self.flag = True
def _value(self):
values = []
for _ in range(25):
values.append(self.adc.read())
time.sleep_us(5)
return (self.range-200) < min(values) < (self.range+200)
def get_presses(self, delay=1):
last_time, presses = time.time(), 0
while time.time() < last_time + delay:
time.sleep_ms(50)
if self.was_pressed():
presses += 1
return presses
def is_pressed(self):
return self._value()
def was_pressed(self):
if (self._value() != self.flag):
self.flag = self._value()
if self.flag:
return True
else:
return False
def irq(self, handler, trigger):
Pin(self.pin, Pin.IN).irq(handler=handler, trigger=trigger)
'''1KEY_Button'''
class Button(KEYSensor):
def __init__(self, pin):
self.pin = pin
self.key = Pin(pin, Pin.IN)
self.flag = True
def _value(self):
return not self.key.value()
B1key = Button(0)
B2key = KEYSensor(17, 0)
A1key = KEYSensor(17, 1600)
A2key = KEYSensor(17, 1100)
A3key = KEYSensor(17, 550)
A4key = KEYSensor(17, 2100)
'''2-LED'''
class LED:
def __init__(self, func):
self._func = func
def setbrightness(self, index, val):
self._func(index, val)
def getbrightness(self, index):
return self._func(index)
def setonoff(self, index, val):
if val == -1:
self.setbrightness(index, 100) if self.getbrightness(
index) < 50 else self.setbrightness(index, 0)
elif val == 1:
self.setbrightness(index, 100)
elif val == 0:
self.setbrightness(index, 0)
def getonoff(self, index):
return True if self.getbrightness(index) > 50 else False
onboard_led = LED(onboard_bot.led_pwm)
class Voice_Energy:
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()
class Clock:
def __init__(self, x, y, radius, color, oled=onboard_tft): # 定义时钟中心点和半径
self.display = oled
self.xc = x
self.yc = y
self.r = radius
self.color = color
self.hour = 0
self.min = 0
self.sec = 0
def set_time(self, h, m, s): # 设定时间
self.hour = h
self.min = m
self.sec = s
def set_rtctime(self): # 设定时间
t = rtc_clock.datetime()
self.hour = t[4]
self.min = t[5]
self.sec = t[6]
def drawDial(self, color): # 画钟表刻度
r_tic1 = self.r - 1
r_tic2 = self.r - 2
self.display.ellipse(self.xc, self.yc, self.r, self.r, color)
self.display.ellipse(self.xc, self.yc, 2, 2, color, True)
for h in range(12):
at = math.pi * 2.0 * h / 12.0
x1 = round(self.xc + r_tic1 * math.sin(at))
x2 = round(self.xc + r_tic2 * math.sin(at))
y1 = round(self.yc - r_tic1 * math.cos(at))
y2 = round(self.yc - r_tic2 * math.cos(at))
self.display.line(x1, y1, x2, y2, color)
def drawHour(self, color): # 画时针
r_hour = int(self.r / 10.0 * 5)
ah = math.pi * 2.0 * ((self.hour % 12) + self.min / 60.0) / 12.0
xh = int(self.xc + r_hour * math.sin(ah))
yh = int(self.yc - r_hour * math.cos(ah))
self.display.line(self.xc, self.yc, xh, yh, color)
def drawMin(self, color): # 画分针
r_min = int(self.r / 10.0 * 7)
am = math.pi * 2.0 * self.min / 60.0
xm = round(self.xc + r_min * math.sin(am))
ym = round(self.yc - r_min * math.cos(am))
self.display.line(self.xc, self.yc, xm, ym, color)
def drawSec(self, color): # 画秒针
r_sec = int(self.r / 10.0 * 9)
asec = math.pi * 2.0 * self.sec / 60.0
xs = round(self.xc + r_sec * math.sin(asec))
ys = round(self.yc - r_sec * math.cos(asec))
self.display.line(self.xc, self.yc, xs, ys, color)
def draw_clock(self, bg_color=0): # 画完整钟表
self.drawDial(self.color)
self.drawHour(self.color)
self.drawMin(self.color)
self.drawSec(self.color)
self.display.show()
self.drawHour(bg_color)
self.drawMin(bg_color)
self.drawSec(bg_color)
def clear(self, color=0): # 清除
self.display.ellipse(self.xc, self.yc, self.r, self.r, color, True)
'''Reclaim memory'''
gc.collect()

View File

@@ -0,0 +1,221 @@
"""
mixgo_soar onboard resources
Micropython library for the mixgo_soar onboard resources
=======================================================
@dahanzimin From the Mixly Team
"""
from ws2812 import NeoPixel
from machine import *
import time
import gc
import math
import st7789_bf
'''RTC'''
rtc_clock = RTC()
'''I2C-onboard'''
# onboard_i2c = I2C(0)
onboard_i2c = SoftI2C(scl=Pin(47), sda=Pin(48), freq=400000)
'''SPI-onboard'''
onboard_spi = SPI(1, baudrate=80000000, polarity=0, phase=0)
'''BOT035-Sensor'''
try:
import soar_bot
onboard_bot = soar_bot.BOT035(onboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with BOT035 (Coprocessor) or", e)
'''BPS-Sensor'''
try:
import spl06_001
onboard_bps = spl06_001.SPL06(onboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with SPL06-001 (BPS) or", e)
'''IMU-Sensor'''
try:
import qmi8658
onboard_imu = qmi8658.QMI8658(onboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with QMI8658 (IMU) or", e)
'''ALS_PS-Sensor'''
try:
import ltr553als
onboard_als = ltr553als.LTR_553ALS(onboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with TR_553ALS (ALS&PS) or", e)
'''MGS-Sensor'''
try:
import mmc5603
onboard_mgs = mmc5603.MMC5603(onboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with MMC5603 (MGS) or", e)
'''TFT/240*240'''
onboard_tft = st7789_bf.ST7789(onboard_spi, 240, 240, dc_pin=46, cs_pin=45, bl_pin=onboard_bot.tft_brightness, brightness=0.6, font_address=0x700000)
'''2RGB_WS2812'''
onboard_rgb = NeoPixel(Pin(40), 4)
'''5KEY_Sensor'''
class KEYSensor:
def __init__(self, pin, range):
self.pin = pin
self.adc = ADC(Pin(pin), atten=ADC.ATTN_0DB)
self.range = range
self.flag = True
def _value(self):
values = []
for _ in range(50):
values.append(self.adc.read())
time.sleep_us(2)
return (self.range-200) < min(values) < (self.range+200)
def get_presses(self, delay=1):
last_time, presses = time.time(), 0
while time.time() < last_time + delay:
time.sleep_ms(50)
if self.was_pressed():
presses += 1
return presses
def is_pressed(self):
return self._value()
def was_pressed(self):
if (self._value() != self.flag):
self.flag = self._value()
if self.flag:
return True
else:
return False
def irq(self, handler, trigger):
Pin(self.pin, Pin.IN).irq(handler=handler, trigger=trigger)
'''1KEY_Button'''
class Button(KEYSensor):
def __init__(self, pin):
self.pin = pin
self.key = Pin(pin, Pin.IN)
self.flag = True
def _value(self):
return not self.key.value()
B1key = Button(0)
B2key = KEYSensor(17, 0)
A1key = KEYSensor(17, 2300)
A2key = KEYSensor(17, 1600)
A3key = KEYSensor(17, 800)
A4key = KEYSensor(17, 2900)
'''2LED-Independent'''
class LED:
def __init__(self, pins=[]):
self._pins = [PWM(Pin(pin), duty_u16=0) for pin in pins]
self._brightness = [0 for _ in range(len(self._pins))]
def setbrightness(self, index, val):
if not 0 <= val <= 100:
raise ValueError("Brightness must be in the range: 0-100%")
self._brightness[index - 1] = val
self._pins[index - 1].duty_u16(val * 65535 // 100)
def getbrightness(self, index):
return self._brightness[index - 1]
def setonoff(self, index, val):
if val == -1:
self.setbrightness(index, 100) if self.getbrightness(
index) < 50 else self.setbrightness(index, 0)
elif val == 1:
self.setbrightness(index, 100)
elif val == 0:
self.setbrightness(index, 0)
def getonoff(self, index):
return True if self.getbrightness(index) > 50 else False
onboard_led = LED([38, 39])
class Clock:
def __init__(self, x, y, radius, color, oled=onboard_tft): # 定义时钟中心点和半径
self.display = oled
self.xc = x
self.yc = y
self.r = radius
self.color = color
self.hour = 0
self.min = 0
self.sec = 0
def set_time(self, h, m, s): # 设定时间
self.hour = h
self.min = m
self.sec = s
def set_rtctime(self): # 设定时间
t = rtc_clock.datetime()
self.hour = t[4]
self.min = t[5]
self.sec = t[6]
def drawDial(self, color): # 画钟表刻度
r_tic1 = self.r - 1
r_tic2 = self.r - 2
self.display.ellipse(self.xc, self.yc, self.r, self.r, color)
self.display.ellipse(self.xc, self.yc, 2, 2, color, True)
for h in range(12):
at = math.pi * 2.0 * h / 12.0
x1 = round(self.xc + r_tic1 * math.sin(at))
x2 = round(self.xc + r_tic2 * math.sin(at))
y1 = round(self.yc - r_tic1 * math.cos(at))
y2 = round(self.yc - r_tic2 * math.cos(at))
self.display.line(x1, y1, x2, y2, color)
def drawHour(self, color): # 画时针
r_hour = int(self.r / 10.0 * 5)
ah = math.pi * 2.0 * ((self.hour % 12) + self.min / 60.0) / 12.0
xh = int(self.xc + r_hour * math.sin(ah))
yh = int(self.yc - r_hour * math.cos(ah))
self.display.line(self.xc, self.yc, xh, yh, color)
def drawMin(self, color): # 画分针
r_min = int(self.r / 10.0 * 7)
am = math.pi * 2.0 * self.min / 60.0
xm = round(self.xc + r_min * math.sin(am))
ym = round(self.yc - r_min * math.cos(am))
self.display.line(self.xc, self.yc, xm, ym, color)
def drawSec(self, color): # 画秒针
r_sec = int(self.r / 10.0 * 9)
asec = math.pi * 2.0 * self.sec / 60.0
xs = round(self.xc + r_sec * math.sin(asec))
ys = round(self.yc - r_sec * math.cos(asec))
self.display.line(self.xc, self.yc, xs, ys, color)
def draw_clock(self, bg_color=0): # 画完整钟表
self.drawDial(self.color)
self.drawHour(self.color)
self.drawMin(self.color)
self.drawSec(self.color)
self.display.show()
self.drawHour(bg_color)
self.drawMin(bg_color)
self.drawSec(bg_color)
def clear(self, color=0): # 清除
self.display.ellipse(self.xc, self.yc, self.r, self.r, color, True)
'''Reclaim memory'''
gc.collect()

View File

@@ -0,0 +1,93 @@
"""
mixgo_soar Voice Onboard resources
Micropython library for the mixgo_soar Onboard resources
=======================================================
@dahanzimin From the Mixly Team
"""
import es8374
import ustruct
import music_spk
from machine import Pin
from esp_i2s import I2S
from esp_tts import TTS
from mixgo_soar import onboard_i2c
ob_code = es8374.ES8374(onboard_i2c)
ob_tts = TTS()
ob_audio = I2S(0, sck=Pin(37), ws=Pin(35), sd_out=Pin(34), sd_in=Pin(36), mck=Pin(33), channels=1)
ob_audio.start()
spk_midi = music_spk.MIDI(ob_audio)
def u2s(n):
return n if n < (1 << 15) else n - (1 << 16)
def sound_level():
buf = bytearray(100)
values = []
ob_audio.readinto(buf)
for i in range(len(buf)//2):
values.append(u2s(buf[i * 2] | buf[i * 2 + 1] << 8))
return max(values) - min(values)
def play_tts(text, speed=3):
ob_audio.stop()
ob_audio.sample_rate = 16000
ob_audio.start()
if ob_tts.parse_chinese(text):
while True:
data = ob_tts.stream_play(speed)
if not data:
break
else:
ob_audio.write(data)
def play_audio(path, chunk=1024):
file = open(path, 'rb')
header = file.read(44)
if header[8:12] != b'WAVE':
raise Error('not a WAVE file')
ob_audio.stop()
ob_audio.sample_rate = ustruct.unpack('<I', header[24:28])[0]
ob_audio.start()
file.seek(44)
while True:
block = file.read(chunk)
if not block:
break
ob_audio.write(block)
file.close()
def record_audio(path, seconds=5, sample_rate=22050, chunk=512):
ob_audio.stop()
ob_audio.sample_rate = sample_rate
ob_audio.start()
file_size = sample_rate * 16 * 1 * seconds // 8
wav_header = bytearray(44)
wav_header[0:4] = b'RIFF'
ustruct.pack_into('<I', wav_header, 4, file_size + 36)
wav_header[8:40] = b'WAVEfmt \x10\x00\x00\x00\x01\x00\x01\x00"V\x00\x00D\xac\x00\x00\x02\x00\x10\x00data'
ustruct.pack_into('<I', wav_header, 40, file_size)
buf = bytearray(chunk)
file = open(path, 'wb')
file.write(wav_header)
for _ in range(file_size // chunk):
ob_audio.readinto(buf)
file.write(buf)
file.close()
def play_audio_url(url, chunk=1024):
import urequests
response = urequests.get(url, stream=True)
header = response.raw.read(44)
if header[8:12] != b'WAVE':
raise Error('not a WAVE file')
ob_audio.stop()
ob_audio.sample_rate = ustruct.unpack('<I', header[24:28])[0]
ob_audio.start()
while True:
block = response.raw.read(chunk)
if not block:
break
ob_audio.write(block)
response.close()

View File

@@ -0,0 +1,170 @@
"""
Music buzzer
Micropython library for the Music buzzer
=======================================================
#Based on Author: qiren123(MIDI Music) 20220618
#Make changes to instantiation 20220622
#Increase level reversal selection 20220716
dahanzimin From the Mixly Team
"""
import time
import math
import struct
normal_tone = {
'A1': 55, 'B1': 62, 'C1': 33, 'D1': 37, 'E1': 41, 'F1': 44, 'G1': 49,
'A2': 110, 'B2': 123, 'C2': 65, 'D2': 73, 'E2': 82, 'F2': 87, 'G2': 98,
'A3': 220, 'B3': 247, 'C3': 131, 'D3': 147, 'E3': 165, 'F3': 175, 'G3': 196,
'A4': 440, 'B4': 494, 'C4': 262, 'D4': 294, 'E4': 330, 'F4': 349, 'G4': 392,
'A5': 880, 'B5': 988, 'C5': 523, 'D5': 587, 'E5': 659, 'F5': 698, 'G5': 784,
'A6': 1760, 'B6': 1976, 'C6': 1047, 'D6': 1175, 'E6': 1319, 'F6': 1397, 'G6': 1568,
'A7': 3520, 'B7': 3951, 'C7': 2093, 'D7': 2349, 'E7': 2637, 'F7': 2794, 'G7': 3135,
'A8': 7040, 'B8': 7902, 'C8': 4186, 'D8': 4699, 'E8': 5274, 'F8': 5588, 'G8': 6271,
'A9': 14080, 'B9': 15804}
Letter = 'ABCDEFG#R'
class MIDI():
def __init__(self, i2s_bus, rate=22050):
self.reset()
self._rate = rate
self.i2s_bus = i2s_bus
def _wave(self, frequency):
_period = self._rate // frequency
_samples = bytearray()
for i in range(_period):
sample = 32768 + int((32767) * math.sin(2 * math.pi * i / _period))
_samples.extend(struct.pack("<h", sample))
return bytes(_samples)
def _tone(self, frequency, duration_ms=1000):
_wave = self._wave(frequency)
_samples = self._rate * duration_ms // 1000
_data = _wave * (_samples // (len(_wave) // 2) + 1)
_data = _data[:_samples * 2]
_wbytes = 0
while _wbytes < len(_data):
send_size = min(512, len(_data) - _wbytes)
self.i2s_bus.write(_data[_wbytes: _wbytes + send_size])
_wbytes += send_size
def set_tempo(self, ticks=4, bpm=120):
self.ticks = ticks
self.bpm = bpm
self.beat = 60000 / self.bpm / self.ticks
def set_octave(self, octave=4):
self.octave = octave
def set_duration(self, duration=4):
self.duration = duration
def get_tempo(self):
return (self.ticks, self.bpm)
def get_octave(self):
return self.octave
def get_duration(self):
return self.duration
def reset(self):
self.set_duration()
self.set_octave()
self.set_tempo()
def parse(self, tone, dict):
time = self.beat * self.duration
pos = tone.find(':')
if pos != -1:
time = self.beat * int(tone[(pos + 1):])
tone = tone[:pos]
freq, tone_size = 1, len(tone)
if 'R' in tone:
freq = 20000
elif tone_size == 1:
freq = dict[tone[0] + str(self.octave)]
elif tone_size == 2:
freq = dict[tone]
self.set_octave(tone[1:])
return int(freq), int(time)
def midi(self, tone):
pos = tone.find('#')
if pos != -1:
return self.parse(tone.replace('#', ''), normal_tone)
pos = tone.find('B')
if pos != -1 and pos != 0:
return self.parse(tone.replace('B', ''), normal_tone)
return self.parse(tone, normal_tone)
def set_default(self, tone):
pos = tone.find(':')
if pos != -1:
self.set_duration(int(tone[(pos + 1):]))
tone = tone[:pos]
def play(self, tune, duration=None):
if duration is None:
self.set_default(tune[0])
else:
self.set_duration(duration)
for tone in tune:
tone = tone.upper()
if tone[0] not in Letter:
continue
midi = self.midi(tone)
self._tone(midi[0], midi[1])
self._tone(20000, 1)
time.sleep_ms(10)
def pitch(self, freq):
pass
def pitch_time(self, freq, delay):
self._tone(freq, delay)
time.sleep_ms(10)
def stop(self):
pass
DADADADUM = ['r4:2', 'g', 'g', 'g', 'eb:8', 'r:2', 'f', 'f', 'f', 'd:8']
ENTERTAINER = ['d4:1', 'd#', 'e', 'c5:2', 'e4:1', 'c5:2', 'e4:1',
'c5:3', 'c:1', 'd', 'd#', 'e', 'c', 'd', 'e:2', 'b4:1', 'd5:2', 'c:4']
PRELUDE = ['c4:1', 'e', 'g', 'c5', 'e', 'g4', 'c5', 'e', 'c4', 'e', 'g', 'c5', 'e', 'g4', 'c5', 'e', 'c4', 'd', 'g', 'd5', 'f', 'g4', 'd5', 'f', 'c4', 'd', 'g', 'd5', 'f', 'g4', 'd5',
'f', 'b3', 'd4', 'g', 'd5', 'f', 'g4', 'd5', 'f', 'b3', 'd4', 'g', 'd5', 'f', 'g4', 'd5', 'f', 'c4', 'e', 'g', 'c5', 'e', 'g4', 'c5', 'e', 'c4', 'e', 'g', 'c5', 'e', 'g4', 'c5', 'e']
ODE = ['e4', 'e', 'f', 'g', 'g', 'f', 'e', 'd', 'c', 'c', 'd', 'e', 'e:6', 'd:2', 'd:8',
'e:4', 'e', 'f', 'g', 'g', 'f', 'e', 'd', 'c', 'c', 'd', 'e', 'd:6', 'c:2', 'c:8']
NYAN = ['f#5:1', 'g#', 'c#:1', 'd#:2', 'b4:1', 'd5:1', 'c#', 'b4:2', 'b', 'c#5', 'd', 'd:1', 'c#', 'b4:1', 'c#5:1', 'd#', 'f#', 'g#', 'd#', 'f#', 'c#', 'd', 'b4', 'c#5', 'b4', 'd#5:2', 'f#', 'g#:1', 'd#', 'f#', 'c#', 'd#', 'b4', 'd5', 'd#', 'd', 'c#', 'b4', 'c#5', 'd:2', 'b4:1', 'c#5', 'd#', 'f#', 'c#', 'd', 'c#', 'b4', 'c#5:2', 'b4', 'c#5',
'b4', 'f#:1', 'g#', 'b:2', 'f#:1', 'g#', 'b', 'c#5', 'd#', 'b4', 'e5', 'd#', 'e', 'f#', 'b4:2', 'b', 'f#:1', 'g#', 'b', 'f#', 'e5', 'd#', 'c#', 'b4', 'f#', 'd#', 'e', 'f#', 'b:2', 'f#:1', 'g#', 'b:2', 'f#:1', 'g#', 'b', 'b', 'c#5', 'd#', 'b4', 'f#', 'g#', 'f#', 'b:2', 'b:1', 'a#', 'b', 'f#', 'g#', 'b', 'e5', 'd#', 'e', 'f#', 'b4:2', 'c#5']
RINGTONE = ['c4:1', 'd', 'e:2', 'g', 'd:1', 'e',
'f:2', 'a', 'e:1', 'f', 'g:2', 'b', 'c5:4']
FUNK = ['c2:2', 'c', 'd#', 'c:1', 'f:2', 'c:1', 'f:2', 'f#',
'g', 'c', 'c', 'g', 'c:1', 'f#:2', 'c:1', 'f#:2', 'f', 'd#']
BLUES = ['c2:2', 'e', 'g', 'a', 'a#', 'a', 'g', 'e', 'c2:2', 'e', 'g', 'a', 'a#', 'a', 'g', 'e', 'f', 'a', 'c3', 'd', 'd#', 'd', 'c',
'a2', 'c2:2', 'e', 'g', 'a', 'a#', 'a', 'g', 'e', 'g', 'b', 'd3', 'f', 'f2', 'a', 'c3', 'd#', 'c2:2', 'e', 'g', 'e', 'g', 'f', 'e', 'd']
BIRTHDAY = ['c4:4', 'c:1', 'd:4', 'c:4', 'f', 'e:8', 'c:3', 'c:1', 'd:4', 'c:4', 'g',
'f:8', 'c:3', 'c:1', 'c5:4', 'a4', 'f', 'e', 'd', 'a#:3', 'a#:1', 'a:4', 'f', 'g', 'f:8']
WEDDING = ['c4:4', 'f:3', 'f:1', 'f:8', 'c:4', 'g:3', 'e:1', 'f:8',
'c:4', 'f:3', 'a:1', 'c5:4', 'a4:3', 'f:1', 'f:4', 'e:3', 'f:1', 'g:8']
FUNERAL = ['c3:4', 'c:3', 'c:1', 'c:4', 'd#:3',
'd:1', 'd:3', 'c:1', 'c:3', 'b2:1', 'c3:4']
PUNCHLINE = ['c4:3', 'g3:1', 'f#', 'g', 'g#:3', 'g', 'r', 'b', 'c4']
PYTHON = ['d5:1', 'b4', 'r', 'b', 'b', 'a#', 'b', 'g5', 'r', 'd', 'd', 'r', 'b4', 'c5', 'r', 'c', 'c', 'r', 'd', 'e:5', 'c:1', 'a4', 'r', 'a', 'a', 'g#', 'a', 'f#5', 'r', 'e', 'e', 'r', 'c', 'b4', 'r', 'b', 'b', 'r', 'c5', 'd:5',
'd:1', 'b4', 'r', 'b', 'b', 'a#', 'b', 'b5', 'r', 'g', 'g', 'r', 'd', 'c#', 'r', 'a', 'a', 'r', 'a', 'a:5', 'g:1', 'f#:2', 'a:1', 'a', 'g#', 'a', 'e:2', 'a:1', 'a', 'g#', 'a', 'd', 'r', 'c#', 'd', 'r', 'c#', 'd:2', 'r:3']
BADDY = ['c3:3', 'r', 'd:2', 'd#', 'r', 'c', 'r', 'f#:8']
CHASE = ['a4:1', 'b', 'c5', 'b4', 'a:2', 'r', 'a:1', 'b', 'c5', 'b4', 'a:2', 'r', 'a:2', 'e5', 'd#', 'e', 'f', 'e', 'd#',
'e', 'b4:1', 'c5', 'd', 'c', 'b4:2', 'r', 'b:1', 'c5', 'd', 'c', 'b4:2', 'r', 'b:2', 'e5', 'd#', 'e', 'f', 'e', 'd#', 'e']
BA_DING = ['b5:1', 'e6:3']
WAWAWAWAA = ['e3:3', 'r:1', 'd#:3', 'r:1', 'd:4', 'r:1', 'c#:8']
JUMP_UP = ['c5:1', 'd', 'e', 'f', 'g']
JUMP_DOWN = ['g5:1', 'f', 'e', 'd', 'c']
POWER_UP = ['g4:1', 'c5', 'e4', 'g5:2', 'e5:1', 'g5:3']
POWER_DOWN = ['g5:1', 'd#', 'c', 'g4:2', 'b:1', 'c5:3']

View File

@@ -0,0 +1,112 @@
"""
NOVA_G1
Micropython library for the NOVA_G1(PWM*6, IO*2, ADC*1)
=======================================================
#Preliminary composition 20240222
@dahanzimin From the Mixly Team
"""
from micropython import const
from mixgo_nova import onboard_i2c
_NOVA_G1_ADDRESS = const(0x25)
_NOVA_G1_ID = const(0x00)
_NOVA_G1_ADC = const(0x01)
_NOVA_G1_IO = const(0x03)
_NOVA_G1_PWM = const(0x04)
class NOVA_G1:
def __init__(self, i2c_bus, addr=_NOVA_G1_ADDRESS):
self._i2c = i2c_bus
self._addr = addr
if self._rreg(_NOVA_G1_ID) != 0x25:
raise AttributeError("Cannot find a NOVA_G1")
self.reset()
def _wreg(self, reg, val):
'''Write memory address'''
try:
self._i2c.writeto_mem(self._addr, reg, val.to_bytes(1, 'little'))
except:
return 0
def _rreg(self, reg, nbytes=1):
'''Read memory address'''
try:
self._i2c.writeto(self._addr, reg.to_bytes(1, 'little'))
return self._i2c.readfrom(self._addr, nbytes)[0] if nbytes <= 1 else self._i2c.readfrom(self._addr, nbytes)[0:nbytes]
except:
return 0
def reset(self):
"""Reset all registers to default state"""
for reg in range(_NOVA_G1_PWM, _NOVA_G1_PWM + 6):
self._wreg(reg, 0x00)
def varistor(self, ratio=100/1023):
'''Read battery power'''
_adc = self._rreg(_NOVA_G1_ADC) << 2 | self._rreg(_NOVA_G1_ADC+1) >> 6
return round(_adc * ratio)
def pwm(self, index, duty=None):
"""Motor*2*2 & USB*2 PWM duty cycle data register"""
if duty is None:
return self._rreg(_NOVA_G1_PWM + index)
else:
duty = min(255, max(0, duty))
self._wreg(_NOVA_G1_PWM + index, duty)
def motor(self, index, action, speed=0):
if not 0 <= index <= 1:
raise ValueError("Motor port must be a number in the range: 0~1")
speed = min(100, max(speed, -100))
if action == "N":
self.pwm(index * 2, 0)
self.pwm(index * 2 + 1, 0)
elif action == "P":
self.pwm(index * 2, 255)
self.pwm(index * 2 + 1, 255)
elif action == "CW":
if speed >= 0:
self.pwm(index * 2, 0)
self.pwm(index * 2 + 1, speed * 255 // 100)
else:
self.pwm(index * 2, 0)
self.pwm(index * 2 + 1, - speed * 255 // 100)
elif action == "CCW":
if speed >= 0:
self.pwm(index * 2, speed * 255 // 100)
self.pwm(index * 2 + 1, 0)
else:
self.pwm(index * 2, - speed * 255 // 100)
self.pwm(index * 2 + 1, 0)
elif action == "NC":
return round(self.pwm(index * 2) * 100 / 255), round(self.pwm(index * 2 + 1) * 100 / 255)
else:
raise ValueError('Invalid input, valid are "N","P","CW","CCW"')
def usb_pwm(self, index, duty=None):
if not 0 <= index <= 1:
raise ValueError("USB-2.0 port must be a number in the range: 0~1")
if duty is None:
return round((self.pwm(index + 4) * 100 / 255))
else:
self.pwm(index + 4, duty * 255 // 100)
def spk_en(self, onoff=True):
if onoff:
self._wreg(_NOVA_G1_IO, (self._rreg(_NOVA_G1_IO)) | 0x02)
else:
self._wreg(_NOVA_G1_IO, (self._rreg(_NOVA_G1_IO)) & 0xFD)
def ldo_en(self, onoff=True):
if onoff:
self._wreg(_NOVA_G1_IO, (self._rreg(_NOVA_G1_IO)) | 0x01)
else:
self._wreg(_NOVA_G1_IO, (self._rreg(_NOVA_G1_IO)) & 0xFE)
# Constructor
ext_g1 = NOVA_G1(onboard_i2c)

View File

@@ -0,0 +1,137 @@
"""
SANT_WCH
Micropython library for the SANT_WCH(--V1.8--)
=======================================================
@dahanzimin From the Mixly Team
"""
import time
from micropython import const
_BOT035_ADDRESS = const(0x13)
_BOT5_TOUCH = const(0x01)
_BOT035_ADC = const(0x05)
_BOT035_PWM = const(0x09)
_BOT035_LED = const(0x0F)
_BOT035_STA = const(0x12)
_BOT035_CMD = const(0x13)
_BOT035_RGB = const(0x14)
_BOT035_KB = const(0x20)
_BOT035_MS = const(0x24)
_BOT035_STR = const(0x28)
class BOT035:
def __init__(self, i2c_bus):
self._i2c = i2c_bus
self._touchs = [self.touch(0), self.touch(1)]
self.reset()
def _wreg(self, reg, val, digit=1):
'''Write memory address'''
self._i2c.writeto_mem(_BOT035_ADDRESS, reg, val.to_bytes(digit, 'little'))
def _rreg(self, reg, nbytes=1):
'''Read memory address'''
self._i2c.writeto(_BOT035_ADDRESS, reg.to_bytes(1, 'little'))
return int.from_bytes(self._i2c.readfrom(_BOT035_ADDRESS, nbytes), 'little')
def _bits(self, offset, mask, value=None, delay=100, reg=_BOT035_CMD):
if value is None:
return (self._rreg(reg) & mask) >> offset
else:
self._wreg(reg, (self._rreg(reg) & (~ mask & 0xFF)) | (value << offset))
time.sleep_ms(delay)
def reset(self):
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_PWM, b' Ndddd\x00\x00\x00\x8c\x20')
def key_adc(self):
return self._rreg(_BOT035_ADC, 2)
def touch(self, index, value=None):
index = max(min(index, 1), 0)
touch = 4095 - self._rreg(_BOT5_TOUCH + index * 2, 2)
return touch > value if value else touch
def touched(self, index, value=600):
return self.touch(index, value)
def touch_slide(self):
values = []
for i in range(20):
values.append((self.touch(1) - self._touchs[1]) - (self.touch(0) - self._touchs[0]))
return round(sorted(values)[10] / 10)
def usben(self, index=1, duty=None, freq=None):
index = max(min(index, 4), 1)
if duty is not None:
self._wreg(_BOT035_PWM + index + 1, int(max(min(duty, 100), 0)))
if freq is not None:
self._wreg(_BOT035_PWM, max(min(freq, 65535), 10), 2)
if freq is None and duty is None:
return self._rreg(_BOT035_PWM + index + 1), self._rreg(_BOT035_PWM ,2)
def tft_brightness(self, brightness=None):
if brightness is None:
return self._rreg(_BOT035_LED)
else:
self._wreg(_BOT035_LED, max(min(brightness, 100), 0))
def led_pwm(self, index=1, duty=None):
index = max(min(index, 2), 1)
if duty is None:
return self._rreg(_BOT035_LED + index)
else:
self._wreg(_BOT035_LED + index, max(min(duty, 100), 0))
def tft_reset(self, value=None, delay=50):
return self._bits(7, 0x80, value, delay)
def spk_en(self, value=None, delay=10):
return self._bits(6, 0x40, value, delay)
def cam_en(self, value=None, delay=500):
"""Convert to high level effective"""
value = value if value is None else ~ value & 0x01
return self._bits(5, 0x20, value, delay)
def cam_reset(self, value=None, delay=50):
return self._bits(4, 0x10, value, delay)
def asr_en(self, value=None, delay=700):
return self._bits(2, 0x0C, value, delay)
def uart_select(self, value=None, delay=50):
return self._bits(0, 0x03, value, delay)
def rgb_sync(self, buffer, n=12):
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_RGB, buffer if len(buffer) < n else buffer[:n])
def hid_keyboard(self, special=0, general=0, release=True):
self._buf = bytearray(4)
self._buf[0] = special
if type(general) in (tuple, list):
for i in range(len(general)):
if i > 2: break
self._buf[i + 1] = general[i]
else:
self._buf[1] = general
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_KB, self._buf)
if release:
time.sleep_ms(10)
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_KB, bytes(4))
def hid_keyboard_str(self, string, delay=0):
for char in str(string):
self._wreg(_BOT035_STR, ord(char) & 0xFF)
time.sleep_ms(20 + delay)
def hid_keyboard_state(self):
state = self._rreg(_BOT035_STA)
return bool(state & 0x10), bool(state & 0x20), bool(state & 0x40)
def hid_mouse(self, keys=0, move=(0, 0), wheel=0, release=True):
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_MS, bytes([keys & 0x0F, move[0] & 0xFF, move[1] & 0xFF, wheel & 0xFF]))
if release:
time.sleep_ms(10)
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_MS, bytes(4))

View File

@@ -0,0 +1,30 @@
"""
SANT G2 -MixGo SANT EXT G2
MicroPython library for the SANT G2 (Expansion board for MixGo SANT)
=======================================================
@dahanzimin From the Mixly Team
"""
import gc
from machine import Pin, SoftI2C
'''i2c-extboard'''
ext_i2c = SoftI2C(scl=Pin(5), sda=Pin(6), freq=400000)
'''RFID_Sensor'''
try :
import rc522
ext_rfid = rc522.RC522(ext_i2c)
except Exception as e:
print("Warning: Failed to communicate with SI522A (RFID) or",e)
'''RADAR_Sensor'''
try :
import cbr817
ext_mmw = cbr817.CBR817(ext_i2c)
except Exception as e:
print("Warning: Failed to communicate with CBR817 (RADAR) or",e)
'''Reclaim memory'''
gc.collect()

View File

@@ -0,0 +1,30 @@
"""
SANT GX -MixGo SANT EXT G3
MicroPython library for the SANT GX (Expansion board for MixGo SANT)
=======================================================
@dahanzimin From the Mixly Team
"""
import gc
from machine import Pin, SoftI2C
'''i2c-extboard'''
ext_i2c = SoftI2C(scl=Pin(18), sda=Pin(21), freq=400000)
'''RFID_Sensor'''
try :
import rc522
ext_rfid = rc522.RC522(ext_i2c)
except Exception as e:
print("Warning: Failed to communicate with SI522A (RFID) or",e)
'''RADAR_Sensor'''
try :
import cbr817
ext_mmw = cbr817.CBR817(ext_i2c)
except Exception as e:
print("Warning: Failed to communicate with CBR817 (RADAR) or",e)
'''Reclaim memory'''
gc.collect()

View File

@@ -0,0 +1,31 @@
"""
SANT-TTS
MicroPython library for the SANT-TTS(暂行)
=======================================================
@dahanzimin From the Mixly Team
"""
import gc
from esp_tts import TTS
from machine import Pin
from pwm_audio import PWMAudio
from mixgo_sant import onboard_bot
audio = PWMAudio(Pin(46))
tts = TTS()
def play(text, speed=3):
try:
onboard_bot.spk_en(1, 100)
if tts.parse_chinese(text):
audio.start()
while True:
data = tts.stream_play(speed)
if not data:
break
else:
audio.write(data)
finally:
onboard_bot.spk_en(0)
audio.stop()
gc.collect()

View File

@@ -0,0 +1,106 @@
"""
SOAR_WCH
Micropython library for the SOAR_WCH
=======================================================
@dahanzimin From the Mixly Team
"""
import time
from micropython import const
_BOT035_ADDRESS = const(0x13)
_BOT5_TOUCH = const(0x01)
_BOT035_ADC = const(0x05)
_BOT035_OPA = const(0x09)
_BOT035_PWM = const(0x0B)
_BOT035_CMD = const(0x11)
_BOT035_STA = const(0x12)
_BOT035_KB = const(0x13)
_BOT035_MS = const(0x17)
_BOT035_STR = const(0x1B)
class BOT035:
def __init__(self, i2c_bus):
self._i2c = i2c_bus
self._touchs = [self.touch(0), self.touch(1)]
self.reset()
def _wreg(self, reg, val, digit=1):
'''Write memory address'''
self._i2c.writeto_mem(_BOT035_ADDRESS, reg, val.to_bytes(digit, 'little'))
def _rreg(self, reg, nbytes=1):
'''Read memory address'''
self._i2c.writeto(_BOT035_ADDRESS, reg.to_bytes(1, 'little'))
return int.from_bytes(self._i2c.readfrom(_BOT035_ADDRESS, nbytes), 'little')
def reset(self):
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_PWM, b' Ndddd\xc0')
def touch(self, index, value=None):
index = max(min(index, 1), 0)
touch = 4095 - self._rreg(_BOT5_TOUCH + index * 2, 2)
return touch > value if value else touch
def touched(self, index, value=600):
return self.touch(index, value)
def touch_slide(self):
values = []
for i in range(20):
values.append((self.touch(1) - self._touchs[1]) - (self.touch(0) - self._touchs[0]))
return round(sorted(values)[10] / 10)
def brightness(self, index):
index = max(min(index, 1), 0)
return 4095 - self._rreg(_BOT035_ADC + index * 2, 2)
def amp_pga(self, k=1, b=155, pga=3, dp=0):
"""0:4x,1:8x,2:16x,3:32x"""
self._wreg(_BOT035_CMD, (self._rreg(_BOT035_CMD) & 0x3F) | (pga & 0x03) << 6)
return round((self._rreg(_BOT035_OPA, 2) * k - b) / (2 ** (pga + 2)), dp)
def usben(self, index=1, duty=None, freq=None):
index = max(min(index, 4), 1)
if duty is not None:
self._wreg(_BOT035_PWM + index + 1, int(max(min(duty, 100), 0)))
if freq is not None:
self._wreg(_BOT035_PWM, max(min(freq, 65535), 10), 2)
if freq is None and duty is None:
return self._rreg(_BOT035_PWM + index + 1), self._rreg(_BOT035_PWM ,2)
def tft_brightness(self, brightness=None):
if brightness is None:
return round((self._rreg(_BOT035_CMD) & 0x3F) * 1.587)
else:
brightness = round(brightness* 0.63)
self._wreg(_BOT035_CMD, (self._rreg(_BOT035_CMD) & 0xC0) | max(min(brightness, 63), 0))
def hid_keyboard(self, special=0, general=0, release=True):
self._buf = bytearray(4)
self._buf[0] = special
if type(general) in (tuple, list):
for i in range(len(general)):
if i > 2: break
self._buf[i + 1] = general[i]
else:
self._buf[1] = general
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_KB, self._buf)
if release:
time.sleep_ms(10)
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_KB, bytes(4))
def hid_keyboard_str(self, string, delay=0):
for char in str(string):
self._wreg(_BOT035_STR, ord(char) & 0xFF)
time.sleep_ms(20 + delay)
def hid_keyboard_state(self):
state = self._rreg(_BOT035_STA)
return bool(state & 0x10), bool(state & 0x20), bool(state & 0x40)
def hid_mouse(self, keys=0, move=(0, 0), wheel=0, release=True):
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_MS, bytes([keys & 0x0F, move[0] & 0xFF, move[1] & 0xFF, wheel & 0xFF]))
if release:
time.sleep_ms(10)
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_MS, bytes(4))

View File

@@ -0,0 +1,103 @@
"""
ST7789/FrameBuffer
MicroPython library for the ST7789(TFT-SPI)
=======================================================
@dahanzimin From the Mixly Team
"""
import time
import uframebuf
from machine import Pin, PWM
class ST7789(uframebuf.FrameBuffer_Uincode):
def __init__(self, spi, width, height, dc_pin=None, cs_pin=None, bl_pin=None, brightness=0.6, font_address=0x700000):
self.spi = spi
self.dc = Pin(dc_pin, Pin.OUT, value=1)
self.cs = Pin(cs_pin, Pin.OUT, value=1)
self._buffer = bytearray(width * height * 2)
super().__init__(self._buffer, width, height, uframebuf.RGB565)
self.font(font_address)
self._init()
# self.show()
self.bl_led = bl_pin if callable(bl_pin) else PWM(Pin(bl_pin))
self._oneclight = True
self._brightness = brightness
def _write(self, cmd, dat=None):
self.cs.off()
self.dc.off()
self.spi.write(bytearray([cmd]))
self.cs.on()
if dat is not None:
self.cs.off()
self.dc.on()
self.spi.write(dat)
self.cs.on()
def _init(self):
"""Display initialization configuration"""
for cmd, data, delay in [
(0x11, None, 120000),
(0x36, b'\x00', 10),
(0x3A, b'\x05', 10),
(0xB2, b'\x1F\x1F\x00\x33\x33', 10),
(0xB7, b'\x00', 10),
(0xBB, b'\x3F', 10),
(0xC0, b'\x2C', 10),
(0xC2, b'\x01', 10),
(0xC3, b'\x0F', 10),
(0xC4, b'\x20', 10),
(0xC6, b'\x13', 10),
(0xD0, b'\xA4\xA1', 10),
(0xD6, b'\xA1', 10),
(0xE0, b'\xF0\x06\x0D\x0B\x0A\x07\x2E\x43\x45\x38\x14\x13\x25\x29', 10),
(0xE1, b'\xF0\x07\x0A\x08\x07\x23\x2E\x33\x44\x3A\x16\x17\x26\x2C', 10),
(0xE4, b'\x1D\x00\x00', 10),
(0x21, None, 10),
(0x29, None, 10),
]:
self._write(cmd, data)
if delay:
time.sleep_us(delay)
def _write(self, command=None, data=None):
"""SPI write to the device: commands and data."""
if command is not None:
self.cs.off()
self.dc.off()
self.spi.write(bytes([command]))
self.cs.on()
if data is not None:
self.cs.off()
self.dc.on()
self.spi.write(data)
self.cs.on()
def get_brightness(self):
return self._brightness
def set_brightness(self, brightness):
if not 0.0 <= brightness <= 1.0:
raise ValueError(
"Brightness must be a decimal number in the range: 0.0~1.0")
self._brightness = brightness
if callable(self.bl_led):
self.bl_led(brightness * 100)
elif isinstance(self.bl_led, PWM):
self.bl_led.duty_u16(int(brightness * 60000))
def color(self, red, green=None, blue=None):
""" Convert red, green and blue values (0-255) into a 16-bit 565 encoding."""
if green is None or blue is None:
return red
else:
return (red & 0xf8) << 8 | (green & 0xfc) << 3 | blue >> 3
def show(self):
"""Refresh the display and show the changes."""
if self._oneclight:
self.set_brightness(self._brightness)
self._oneclight = False
self._write(0x2A, b'\x00\x00\x00\xef')
self._write(0x2B, b'\x00\x00\x00\xef')
self._write(0x2C, self._buffer)

View File

@@ -0,0 +1,95 @@
"""
ST7789/FrameBuffer
MicroPython library for the ST7789(TFT-SPI)
=======================================================
@dahanzimin From the Mixly Team
"""
import time
import uframebuf
from machine import Pin
from camera import Image, IMG
class ST7789(uframebuf.FrameBuffer_Uincode):
def __init__(self, spi, width, height, dc_pin=None, backlight=None, reset=None, font_address=0x700000):
self.spi = spi
self.dc = Pin(dc_pin, Pin.OUT, value=1)
self._buffer = bytearray(width * height * 2)
super().__init__(self._buffer, width, height, uframebuf.RGB565)
if reset: reset(1, 100)
self.font(font_address)
self._init()
# self.show()
self._oneclight = True
self._backlight = backlight
def display(self, data=None, x=None, y=None, scale_width=None, scale_height=None, rotation=0, sync=True):
if type(data) is str:
data = Image.open(data, scale_width, scale_height, self.width, self.height, rotation=rotation)
if sync: self.fill(0x0, sync=False)
self.blit_rgb565(data.image, data.width, data.height, x, y)
if sync: self.show()
def screenshot(self, x=0, y=0, w=None, h=None):
if (w is None and h is None):
return IMG(memoryview(self._buffer), self.width, self.height)
else:
return IMG(memoryview(self.crop_rgb565(x,y,w,h)), w, h)
def _write(self, cmd, dat=None):
self.dc.off()
self.spi.write(bytearray([cmd]))
if dat is not None:
self.dc.on()
self.spi.write(dat)
def _init(self):
"""Display initialization configuration"""
for cmd, data, delay in [
(0x11, None, 120000),
(0x36, b'\x00', 50),
(0x3A, b'\x05', 50),
(0xB2, b'\x1F\x1F\x00\x33\x33', 10),
(0xB7, b'\x00', 10),
(0xBB, b'\x36', 10),
(0xC0, b'\x2C', 10),
(0xC2, b'\x01', 10),
(0xC3, b'\x13', 10),
(0xC4, b'\x20', 10),
(0xC6, b'\x13', 10),
(0xD0, b'\xA4\xA1', 10),
(0xD6, b'\xA1', 10),
(0xE0, b'\xF0\x08\x0E\x09\x08\x04\x2F\x33\x45\x36\x13\x12\x2A\x2D', 10),
(0xE1, b'\xF0\x0E\x12\x0C\x0A\x15\x2E\x32\x44\x39\x17\x18\x2B\x2F', 10),
(0xE4, b'\x1D\x00\x00', 10),
(0x21, None, 10),
(0x29, None, 10),
]:
self._write(cmd, data)
if delay:
time.sleep_us(delay)
def get_brightness(self):
return self._backlight() / 100
def set_brightness(self, brightness):
if not 0.0 <= brightness <= 1.0:
raise ValueError(
"Brightness must be a decimal number in the range: 0.0~1.0")
self._backlight(int(brightness * 100))
def color(self, red, green=None, blue=None):
""" Convert red, green and blue values (0-255) into a 16-bit 565 encoding."""
if green is None or blue is None:
return red
else:
return (red & 0xf8) << 8 | (green & 0xfc) << 3 | blue >> 3
def show(self):
"""Refresh the display and show the changes."""
if self._oneclight:
self.set_brightness(0.6)
self._oneclight = False
self._write(0x2A, b'\x00\x00\x00\xef')
self._write(0x2B, b'\x00\x00\x00\xef')
self._write(0x2C, self._buffer)

View File

@@ -0,0 +1,67 @@
"""
WS2812 RGB(x035)
Micropython library for the WS2812 NeoPixel-RGB(method inheritance)
=======================================================
@dahanzimin From the Mixly Team
"""
from time import sleep
class NeoPixel:
def __init__(self, func, n, bpp=3, ORDER=(0, 1, 2, 3)):
self.func = func
self.bpp = bpp
self.rgbs = n
self.ORDER = ORDER
self.rgb_buf = bytearray(self.rgbs * bpp)
self.write()
def __len__(self):
return self.rgbs
def __setitem__(self, n, v):
for i in range(self.bpp):
self.rgb_buf[n * self.bpp + self.ORDER[i]] = v[i]
def __getitem__(self, n):
return tuple(self.rgb_buf[n * self.bpp + self.ORDER[i]] for i in range(self.bpp))
def fill(self, v):
for i in range(self.bpp):
j = self.ORDER[i]
while j < self.rgbs * self.bpp:
self.rgb_buf[j] = v[i]
j += self.bpp
def write(self):
self.func(self.rgb_buf)
def color_chase(self, R, G, B, wait):
for i in range(self.rgbs):
self.__setitem__(i, (R, G, B))
self.write()
sleep(wait/1000)
def rainbow_cycle(self, wait, clear=True):
for j in range(255):
for i in range(self.rgbs):
rc_index = (i * 256 // self.rgbs) + j
self.__setitem__(i, self.wheel(rc_index & 255))
self.write()
sleep(wait / 1000 / 256)
if clear:
self.fill((0, 0, 0))
self.write()
def wheel(self, pos):
if pos < 0 or pos > 255:
return (0, 0, 0)
elif pos < 85:
return (pos * 3, 255 - pos * 3, 0)
elif pos < 170:
pos -= 85
return (255 - pos * 3, 0, pos * 3)
else:
pos -= 170
return (0, pos * 3, 255 - pos * 3)

View File

@@ -0,0 +1,239 @@
{
"board": {
"元控自强SANT": {
"key": "micropython:esp32s3:mixgo_sant",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "921600",
"label": "921600"
},
{
"key": "460800",
"label": "460800"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "115200",
"label": "115200"
}
]
}
]
},
"元控青春NOVA": {
"key": "micropython:esp32s3:mixgo_nova",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "921600",
"label": "921600"
},
{
"key": "460800",
"label": "460800"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "115200",
"label": "115200"
}
]
}
]
},
"元控飞翔SOAR": {
"key": "micropython:esp32s3:mixgo_soar",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "921600",
"label": "921600"
},
{
"key": "460800",
"label": "460800"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "115200",
"label": "115200"
}
]
}
]
},
"S3_generic": {
"key": "micropython:esp32s3:generic",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "921600",
"label": "921600"
},
{
"key": "460800",
"label": "460800"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "115200",
"label": "115200"
}
]
}
]
}
},
"language": "MicroPython",
"burn": {
"type": "command",
"portSelect": "all",
"micropython:esp32s3:mixgo_sant": {
"command": "\"{esptool}\" --chip esp32s3 --port {com} --baud {baudrate} --after hard_reset write_flash -e 0x0 \"{indexPath}/build/Mixgo_Sant_lib_DL-v1.25.0.bin\" 0xF00000 \"{indexPath}/../micropython/build/HZK16_GBK.bin\" 0xC00000 \"{indexPath}/../micropython/build/esp_tts_voice_data_xiaole.dat\""
},
"micropython:esp32s3:mixgo_nova": {
"command": "\"{esptool}\" --chip esp32s3 --port {com} --baud {baudrate} --after hard_reset write_flash -e 0x0 \"{indexPath}/build/Mixgo_Nova_lib-v1.25.0.bin\" 0x700000 \"{indexPath}/../micropython/build/HZK12.bin\" 0x400000 \"{indexPath}/../micropython/build/esp_tts_voice_data_xiaole.dat\""
},
"micropython:esp32s3:mixgo_soar": {
"command": "\"{esptool}\" --chip esp32s3 --port {com} --baud {baudrate} --after hard_reset write_flash -e 0x0 \"{indexPath}/build/Mixgo_Soar_lib-v1.25.0.bin\" 0x700000 \"{indexPath}/../micropython/build/HZK16_GBK.bin\" 0x400000 \"{indexPath}/../micropython/build/esp_tts_voice_data_xiaole.dat\""
},
"micropython:esp32s3:generic": {
"command": "\"{esptool}\" --chip esp32s3 --port {com} --baud {baudrate} --after=no_reset write_flash -e 0x0 \"{indexPath}/build/Generic_S3_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
}
},
"upload": {
"type": "command",
"portSelect": "all",
"libPath": [
"{indexPath}/build/lib",
"{indexPath}/../micropython/build/lib"
],
"command": "\"{ampy}\" -p {com} -d 1 -r \"{reset}\" put \"{indexPath}/build/upload\"",
"filePath": "{indexPath}/build/upload/main.py",
"copyLib": false,
"reset": []
},
"nav": {
"burn": true,
"upload": true,
"save": {
"py": true
},
"setting": {
"thirdPartyLibrary": true
}
},
"serial": {
"ctrlCBtn": true,
"ctrlDBtn": true,
"baudRates": 115200,
"yMax": 100,
"yMin": 0,
"pointNum": 100,
"rts": true,
"dtr": true
},
"lib": {
"mixly": {
"url": [
"http://download.mixlylibs.cloud/mixly3-packages/cloud-libs/micropython_esp32s3/libs.json"
]
}
},
"pythonToBlockly": false,
"web": {
"devices": {
"serial": true,
"hid": true,
"usb":true
},
"burn": {
"erase": true,
"micropython:esp32s3:mixgo_sant": {
"binFile": [
{
"offset": "0x0000",
"path": "./build/Mixgo_Sant_lib_DL-v1.25.0.bin"
}, {
"offset": "0xF00000",
"path": "../micropython/build/HZK16_GBK.bin"
}, {
"offset": "0xC00000",
"path": "../micropython/build/esp_tts_voice_data_xiaole.dat"
}
]
},
"micropython:esp32s3:mixgo_nova": {
"binFile": [
{
"offset": "0x0000",
"path": "./build/Mixgo_Nova_lib-v1.25.0.bin"
}, {
"offset": "0x700000",
"path": "../micropython/build/HZK12.bin"
}, {
"offset": "0x400000",
"path": "../micropython/build/esp_tts_voice_data_xiaole.dat"
}
]
},
"micropython:esp32s3:mixgo_soar": {
"binFile": [
{
"offset": "0x0000",
"path": "./build/Mixgo_Soar_lib-v1.25.0.bin"
}, {
"offset": "0x700000",
"path": "../micropython/build/HZK16_GBK.bin"
}, {
"offset": "0x400000",
"path": "../micropython/build/esp_tts_voice_data_xiaole.dat"
}
]
},
"micropython:esp32s3:generic": {
"binFile": [
{
"offset": "0x0000",
"path": "./build/Generic_S3_lib-v1.25.0.bin"
}, {
"offset": "0x3A0000",
"path": "../micropython/build/HZK12.bin"
}
]
}
},
"upload": {
"reset": []
}
}
}

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="controls_whileUntil" id="bkc}Q7l+KJzY521!}CO(" x="-1505" y="-699"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="J]eV{Vr4yFm9fK+J5ikw"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="display_show_image" id="!mHWd_femn/M._5)W06]"><value name="data"><shadow type="pins_builtinimg" id="O38UAdWkb`eD?wN=f)Q["><field name="PIN">expression_picture.Heart</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="qj`2kjuiEphe3F^Lm._W"><field name="BOOL">TRUE</field></shadow></value><next><block type="display_scroll_string" id="C~IAu}ltbXEx=yF~|!y1"><value name="data"><shadow type="text" id="[Q]s`Hlv~8^J`w?v-Uhv"><field name="TEXT">你好,米思齐!</field></shadow></value></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBleHByZXNzaW9uX3BpY3R1cmUgaW1wb3J0IEhlYXJ0CmZyb20gbWl4Z29fbm92YSBpbXBvcnQgb25ib2FyZF90ZnQKCndoaWxlIFRydWU6CiAgICBvbmJvYXJkX3RmdC5pbWFnZShIZWFydCwgY29sb3I9MHhmZmZmLHN5bmM9VHJ1ZSkKICAgIG9uYm9hcmRfdGZ0LnNjcm9sbCgn5L2g5aW977yM57Gz5oCd6b2Q77yBJywgY29sb3I9MHhmZmZmKQo=</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="controls_whileUntil" id="ZL4ai[r=E=e.lN)z1n@`" x="-1640" y="-807"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="sY;ifb0PyHVSZ@{O,v7("><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="display_show_image" id="g30S|loP40C{G{RJfHG-"><value name="data"><shadow type="pins_builtinimg" id="C$oOsfvUHN_yQLTu_zOl"><field name="PIN">expression_picture.Heart</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="Jb-BI*[Zjsp6^q$J/hQT"><field name="BOOL">TRUE</field></shadow></value><next><block type="display_clear" id="K}2{K.H79g~=g*|gcF({"><value name="boolean"><shadow type="logic_boolean" id="ul~*}jZ]jFEz~Hiy(-Jb"><field name="BOOL">TRUE</field></shadow></value><next><block type="onboard_tft_scroll_string_delay" id="@9Sot;ae/cXw3[T+U^X2"><value name="data"><shadow type="text" id="bK6S~=mm;2:C?I,dL9?E"><field name="TEXT">你好,米思齐!</field></shadow></value><value name="y"><shadow type="math_number" id="a3n[}UE:2pYY`!N-TnQ."><field name="NUM">32</field></shadow></value><value name="size"><shadow type="math_number" id="bTgN_phLiB]B6cCVjWPp"><field name="NUM">5</field></shadow></value><value name="space"><shadow type="math_number" id="D)`qcSll+I)BGXjOw{]M"><field name="NUM">0</field></shadow></value><value name="time"><shadow type="math_number" id="QVO*O_OSEyx9g1r=NW-!"><field name="NUM">5</field></shadow></value><value name="VAR"><shadow type="tuple_create_with_text_return" id="w0k=wZW_d]ZLL1OA{.ju"><field name="TEXT">255,255,0</field></shadow><block type="display_color_seclet" id="m9m0D0)mGLLew]O+)0V6"><field name="COLOR">#ff0000</field></block></value></block></next></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBleHByZXNzaW9uX3BpY3R1cmUgaW1wb3J0IEhlYXJ0CmZyb20gbWl4Z29fbm92YSBpbXBvcnQgb25ib2FyZF90ZnQKCndoaWxlIFRydWU6CiAgICBvbmJvYXJkX3RmdC5pbWFnZShIZWFydCwgY29sb3I9MHhmZmZmLHN5bmM9VHJ1ZSkKICAgIG9uYm9hcmRfdGZ0LmZpbGwoMCxzeW5jPVRydWUpCiAgICBvbmJvYXJkX3RmdC5zY3JvbGwoJ+S9oOWlve+8jOexs+aAnem9kO+8gScsIHk9MzIsIHNpemU9NSwgc3BlZWQ9NSwgc3BhY2U9MCwgY29sb3I9MHhmODAwKQo=</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="controls_whileUntil" id="Ebm2tu4wOV4--e[Z)1in" x="-851" y="-584"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="xg~5hrAkeA}qFgxtsgp}"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="display_show_image" id="j{7nkW0Lu9[+mn8sbiZt"><value name="data"><shadow type="pins_builtinimg" id="Bk)N$/xaQ_dxAAtadbpc"><field name="PIN">expression_picture.Heart</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="?$itlWIVEx*jVgLIWGdh"><field name="BOOL">TRUE</field></shadow></value><next><block type="controls_delay_new" id="xzw{D,)qanq0,F|.I4D_"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="kr5IYSl02;pP}ePjmG0K"><field name="NUM">0.1</field></shadow></value><next><block type="display_show_image" id="@a|Jo}.e[^}+AF8Y`9M1"><value name="data"><shadow type="pins_builtinimg" id="vPv|_PAF2c]Dl|[eAIwY"><field name="PIN">expression_picture.Small_heart</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="qKpgPV/u(jiP.Jd(81$3"><field name="BOOL">TRUE</field></shadow></value><next><block type="controls_delay_new" id="3hy9UoUu}R,9J2F0-2sf"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="U@rA?$wscL2=_q^vD36P"><field name="NUM">0.1</field></shadow></value></block></next></block></next></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBleHByZXNzaW9uX3BpY3R1cmUgaW1wb3J0IEhlYXJ0CmZyb20gbWl4Z29fbm92YSBpbXBvcnQgb25ib2FyZF90ZnQKaW1wb3J0IHRpbWUKZnJvbSBleHByZXNzaW9uX3BpY3R1cmUgaW1wb3J0IFNtYWxsX2hlYXJ0Cgp3aGlsZSBUcnVlOgogICAgb25ib2FyZF90ZnQuaW1hZ2UoSGVhcnQsIGNvbG9yPTB4ZmZmZixzeW5jPVRydWUpCiAgICB0aW1lLnNsZWVwKDAuMSkKICAgIG9uYm9hcmRfdGZ0LmltYWdlKFNtYWxsX2hlYXJ0LCBjb2xvcj0weGZmZmYsc3luYz1UcnVlKQogICAgdGltZS5zbGVlcCgwLjEpCg==</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="display_show_image_or_string_delay" id="v3$};uT,Qq*)V7m@r;#D" x="-918" y="-558"><field name="center">True</field><value name="data"><shadow type="text" id=".G2ZvvA?RCJ_Wt)Reb:U"><field name="TEXT">米思齐</field></shadow></value><value name="space"><shadow type="math_number" id="g[x/AlNK!#{s]L;vgTtl"><field name="NUM">0</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="wQgb|$HWdobz!m9MB^ZE"><field name="BOOL">TRUE</field></shadow></value><next><block type="controls_delay_new" id="uS7qACd[jnjwrtSf3IvL"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="]EEf6sOfL,JayHzf7f{|"><field name="NUM">1</field></shadow></value><next><block type="controls_whileUntil" id="0}fnsqwgVf{PA913_HwG"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="8([k??,xm5W6A5{P{x|p"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="display_show_image" id="tG6U?EU)V?jwpKFShH?1"><value name="data"><shadow type="pins_builtinimg" id="@7V+9PPGvY-;1F|f};xQ"><field name="PIN">expression_picture.Heart</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="IQgL[$qw+`b1Q5qpe~nH"><field name="BOOL">TRUE</field></shadow></value><next><block type="controls_delay_new" id="O!_chf*cFU]$g?R5y2x?"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="W4L,KyN,*Ff-KjigGMdx"><field name="NUM">0.1</field></shadow></value><next><block type="display_show_image" id="w=.-M]fSPXv-MkceR}@x"><value name="data"><shadow type="pins_builtinimg" id="@U+_rV6k#AnNs8TvY!K#"><field name="PIN">expression_picture.Small_heart</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="[33bPO]Ipu*syXVH1hW_"><field name="BOOL">TRUE</field></shadow></value><next><block type="controls_delay_new" id="q8MuJe/7ejlgTYMp*tpg"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="_X6Z+~nA9}WfqcerSV[z"><field name="NUM">0.1</field></shadow></value></block></next></block></next></block></next></block></statement></block></next></block></next></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBvbmJvYXJkX3RmdAppbXBvcnQgdGltZQpmcm9tIGV4cHJlc3Npb25fcGljdHVyZSBpbXBvcnQgSGVhcnQKZnJvbSBleHByZXNzaW9uX3BpY3R1cmUgaW1wb3J0IFNtYWxsX2hlYXJ0CgpvbmJvYXJkX3RmdC5zaG93cygn57Gz5oCd6b2QJywgc3BhY2U9MCwgY2VudGVyPVRydWUsc3luYz1UcnVlKQp0aW1lLnNsZWVwKDEpCndoaWxlIFRydWU6CiAgICBvbmJvYXJkX3RmdC5pbWFnZShIZWFydCwgY29sb3I9MHhmZmZmLHN5bmM9VHJ1ZSkKICAgIHRpbWUuc2xlZXAoMC4xKQogICAgb25ib2FyZF90ZnQuaW1hZ2UoU21hbGxfaGVhcnQsIGNvbG9yPTB4ZmZmZixzeW5jPVRydWUpCiAgICB0aW1lLnNsZWVwKDAuMSkK</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="controls_whileUntil" id="mWFgvZx~B!uO`EN@6D5+" x="-1017" y="-593"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="@lcE+WZl~5[YR1]?giO="><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="v5MD;AD5[1A6hdRZ(9/E"><mutation else="1"></mutation><value name="IF0"><block type="sensor_mixgo_button_is_pressed" id="n.1V.EU*RMIw`)5upu#u"><value name="btn"><shadow type="pins_button" id="e:xrmFi3Q~2B,T@GjO4^"><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO0"><block type="display_show_image" id="x}.v?5|@P2).hGPj1/EI"><value name="data"><shadow type="pins_builtinimg" id="FvFM9CSXsBmS)g:=_Fo_"><field name="PIN">expression_picture.Heart</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="AgsFJ~WN~WT6n9MB,xBJ"><field name="BOOL">TRUE</field></shadow></value></block></statement><statement name="ELSE"><block type="display_show_image" id="]Bp}gs~g,O;j:@EG+zm@"><value name="data"><shadow type="pins_builtinimg" id="~(yuaSuQ`?u1VW4?`ySB"><field name="PIN">expression_picture.Small_heart</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="bmp(=p45[f!ZW2rO,V/J"><field name="BOOL">TRUE</field></shadow></value></block></statement></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1peGdvX25vdmEKZnJvbSBleHByZXNzaW9uX3BpY3R1cmUgaW1wb3J0IEhlYXJ0CmZyb20gbWl4Z29fbm92YSBpbXBvcnQgb25ib2FyZF90ZnQKZnJvbSBleHByZXNzaW9uX3BpY3R1cmUgaW1wb3J0IFNtYWxsX2hlYXJ0Cgp3aGlsZSBUcnVlOgogICAgaWYgbWl4Z29fbm92YS5CMWtleS5pc19wcmVzc2VkKCk6CiAgICAgICAgb25ib2FyZF90ZnQuaW1hZ2UoSGVhcnQsIGNvbG9yPTB4ZmZmZixzeW5jPVRydWUpCiAgICBlbHNlOgogICAgICAgIG9uYm9hcmRfdGZ0LmltYWdlKFNtYWxsX2hlYXJ0LCBjb2xvcj0weGZmZmYsc3luYz1UcnVlKQo=</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="controls_whileUntil" id="/y*^Vk`A_zl|RJzxCnHB" x="-1059" y="-724"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="jbx@=pOm~TM![A*]gqvz"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="]ANrO`NwkT#/_muu/-Vu"><mutation elseif="2" else="1"></mutation><value name="IF0"><block type="logic_operation" id="`8a9cCdqV-jLEG`EO:uI"><field name="OP">AND</field><value name="A"><block type="sensor_mixgo_button_is_pressed" id="33@ykqP.`Ex9.o3jB]2S"><value name="btn"><shadow type="pins_button" id=",uj`en(aP`+ul^{=HA)P"><field name="PIN">B1key</field></shadow></value></block></value><value name="B"><block type="sensor_mixgo_button_is_pressed" id="5-Xriuy1BhpNv2@D0FBZ"><value name="btn"><shadow type="pins_button" id="OWrL#.G7028,sxx/U2it"><field name="PIN">B2key</field></shadow></value></block></value></block></value><statement name="DO0"><block type="display_show_image" id="E/@uOWU0ut)=fP_a$T:s"><value name="data"><shadow type="pins_builtinimg" id="JnlDXRMvaWmc~5L{y48Q"><field name="PIN">expression_picture.Angry</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="K2/cOi35=Iy)fdsQ@u@V"><field name="BOOL">TRUE</field></shadow></value></block></statement><value name="IF1"><block type="sensor_mixgo_button_is_pressed" id="0DklR9FT$~Pyd)I8/|i)"><value name="btn"><shadow type="pins_button" id="sUJf,6F#v(IA1[g{vdd."><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO1"><block type="display_show_image" id="v-GprI8@Jfl[JevqZz{R"><value name="data"><shadow type="pins_builtinimg" id="wZf)(H99MuCT#0xBjv|v"><field name="PIN">expression_picture.Small_heart</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="yZm4NJTib9.OEOYO,_(F"><field name="BOOL">TRUE</field></shadow></value></block></statement><value name="IF2"><block type="sensor_mixgo_button_is_pressed" id="_0YXnl,F^-rBJeycVuVH"><value name="btn"><shadow type="pins_button" id="=FWCn[k]c-~*$iFX{e`/"><field name="PIN">B2key</field></shadow></value></block></value><statement name="DO2"><block type="display_show_image" id="lW3Z1#]JIRcq;$Y]R=k~"><value name="data"><shadow type="pins_builtinimg" id="|e}Q({:_taSXHaeOc4vn"><field name="PIN">expression_picture.Heart</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="EK#=..yNLvA#W.jLHooO"><field name="BOOL">TRUE</field></shadow></value></block></statement><statement name="ELSE"><block type="display_show_image" id="YSxQWqbciUuWOMoYKzqT"><value name="data"><shadow type="pins_builtinimg" id="vCA,~?|$h)tk$WZKlcee"><field name="PIN">expression_picture.Happy</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="RjewpWx6|e!nYAaLx$zK"><field name="BOOL">TRUE</field></shadow></value></block></statement></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1peGdvX25vdmEKZnJvbSBleHByZXNzaW9uX3BpY3R1cmUgaW1wb3J0IEFuZ3J5CmZyb20gbWl4Z29fbm92YSBpbXBvcnQgb25ib2FyZF90ZnQKZnJvbSBleHByZXNzaW9uX3BpY3R1cmUgaW1wb3J0IFNtYWxsX2hlYXJ0CmZyb20gZXhwcmVzc2lvbl9waWN0dXJlIGltcG9ydCBIZWFydApmcm9tIGV4cHJlc3Npb25fcGljdHVyZSBpbXBvcnQgSGFwcHkKCndoaWxlIFRydWU6CiAgICBpZiBtaXhnb19ub3ZhLkIxa2V5LmlzX3ByZXNzZWQoKSBhbmQgbWl4Z29fbm92YS5CMmtleS5pc19wcmVzc2VkKCk6CiAgICAgICAgb25ib2FyZF90ZnQuaW1hZ2UoQW5ncnksIGNvbG9yPTB4ZmZmZixzeW5jPVRydWUpCiAgICBlbGlmIG1peGdvX25vdmEuQjFrZXkuaXNfcHJlc3NlZCgpOgogICAgICAgIG9uYm9hcmRfdGZ0LmltYWdlKFNtYWxsX2hlYXJ0LCBjb2xvcj0weGZmZmYsc3luYz1UcnVlKQogICAgZWxpZiBtaXhnb19ub3ZhLkIya2V5LmlzX3ByZXNzZWQoKToKICAgICAgICBvbmJvYXJkX3RmdC5pbWFnZShIZWFydCwgY29sb3I9MHhmZmZmLHN5bmM9VHJ1ZSkKICAgIGVsc2U6CiAgICAgICAgb25ib2FyZF90ZnQuaW1hZ2UoSGFwcHksIGNvbG9yPTB4ZmZmZixzeW5jPVRydWUpCg==</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="controls_whileUntil" id="xjk:/!,a5U=SArW+Qo`H" x="-1059" y="-724"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="=kn-;xxeLfCackSxCPYR"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_forEach" id="T/C/^-f@6^1O.jm+d^=`"><value name="LIST"><shadow type="list_many_input" id=";A9CtpDSsY763TQ]9Z`1"><field name="CONTENT">0,1,2,3</field></shadow><block type="controls_range" id="_sO{::Q)}-0+LSnVU!Xe"><value name="FROM"><shadow type="math_number" id="vTM$G;I)m8x*w2zL#M}["><field name="NUM">0</field></shadow></value><value name="TO"><shadow type="math_number" id="?7Cigc^oTf)X~JKIdMFq"><field name="NUM">4</field></shadow></value><value name="STEP"><shadow type="math_number" id="x_RI.OC4)[Q)nYH-GH`J"><field name="NUM">1</field></shadow></value></block></value><value name="VAR"><shadow type="variables_get" id="5=x8l7$pB78;{Qq+Kbi("><field name="VAR">i</field></shadow></value><statement name="DO"><block type="actuator_onboard_neopixel_rgb" id="@eya]9I+[-N*yKOfJO|y"><value name="_LED_"><shadow type="math_number" id="`:|I2*5^_-n~xhQ?6H4l"><field name="NUM">0</field></shadow><block type="variables_get" id="{6ezl/$h??,=ZO},?wOT"><field name="VAR">i</field></block></value><value name="RVALUE"><shadow type="math_number" id="f[h){S*Sm_c1M;__vv=s"><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="dZ:7HGqz6,5!WfI.}a=8"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="K~S~Jg?yVTe[?O--z{R4"><field name="NUM">25</field></shadow></value><next><block type="actuator_onboard_neopixel_write" id="7**h{;kc5L]*LO/EWvH_"><next><block type="controls_delay_new" id="}2xXwbK}1DW_F@Vq0$mR"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="w[kemNL#tU]nHL:-Z1^V"><field name="NUM">0.5</field></shadow></value></block></next></block></next></block></statement><next><block type="actuator_onboard_neopixel_rgb_all" id="O=b)3Pf+m[;XPLb4d6(~"><value name="RVALUE"><shadow type="math_number" id="#dLgg`pR:s7akSVU}kZ$"><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="{Jw.Z5ds4#-C4ehU!g!|"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="$`uPYHEYO:D,p0!asLoK"><field name="NUM">0</field></shadow></value><next><block type="actuator_onboard_neopixel_write" id="BU0XqIt!=V=RfXxqBxCs"><next><block type="controls_delay_new" id="vdGf|Q=V{M/w7R+)bbeo"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="50;af`Pdp{NyXfY?e.)c"><field name="NUM">1</field></shadow></value></block></next></block></next></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBvbmJvYXJkX3JnYgppbXBvcnQgdGltZQoKCndoaWxlIFRydWU6CiAgICBmb3IgaSBpbiByYW5nZSgwLCA0LCAxKToKICAgICAgICBvbmJvYXJkX3JnYltpXSA9ICgwLCAwLCAyNSkKICAgICAgICBvbmJvYXJkX3JnYi53cml0ZSgpCiAgICAgICAgdGltZS5zbGVlcCgwLjUpCiAgICBvbmJvYXJkX3JnYi5maWxsKCgwLCAwLCAwKSkKICAgIG9uYm9hcmRfcmdiLndyaXRlKCkKICAgIHRpbWUuc2xlZXAoMSkK</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="controls_whileUntil" id="iup/4Gs2[M0T^8mjq]h=" x="-1059" y="-724"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="oU)SMN|Qa_+Whee9jBI4"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_forEach" id="fkLloce:RCYtx-!kWME."><value name="LIST"><shadow type="list_many_input" id="[(^z_PKLa{.mKU`jYd.:"><field name="CONTENT">0,1,2,3</field></shadow><block type="controls_range" id="yNK`BrQzc6o!mL:$@C.o"><value name="FROM"><shadow type="math_number" id="F)#z2(0idnSruE3cp3Bg"><field name="NUM">0</field></shadow></value><value name="TO"><shadow type="math_number" id="Spf)cTV*9W-}SM-r)Yje"><field name="NUM">4</field></shadow></value><value name="STEP"><shadow type="math_number" id="Xb{pH_wX:9h[0(,3Iw`s"><field name="NUM">1</field></shadow></value></block></value><value name="VAR"><shadow type="variables_get" id="v[YFs)wyX}*uQZQ.(Oxd"><field name="VAR">i</field></shadow></value><statement name="DO"><block type="actuator_onboard_neopixel_rgb_all" id="nbaCc8n6AhwLy9z.P[/T"><value name="RVALUE"><shadow type="math_number" id="}615?ac(bZqBnTp4?9{F"><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="c.zBJ-Y,^EDk{Q;(J9Ar"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="u;2?S#j@x~`1R(kkc)#P"><field name="NUM">0</field></shadow></value><next><block type="actuator_onboard_neopixel_rgb" id="q=/m,ox99`}P[D$HhYTb"><value name="_LED_"><shadow type="math_number" id="x(@HD[g4b+Y$nlYNdyb4"><field name="NUM">0</field></shadow><block type="variables_get" id="Bku:I+bP=Fk1:x@C*3we"><field name="VAR">i</field></block></value><value name="RVALUE"><shadow type="math_number" id="vw{bYIy`h7;.6~yr@)7("><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="EH:EFme9)NcIBJjsz#Tu"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="DExIVh[4;9.wYf8)qK2h"><field name="NUM">25</field></shadow></value><next><block type="actuator_onboard_neopixel_write" id="MZZ86sI?(o`9G~PYL{C^"><next><block type="controls_delay_new" id="?|a-zKE-;b(gd9Jw$#h;"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="uJH}7Wyq149Agz5anG9+"><field name="NUM">0.5</field></shadow></value></block></next></block></next></block></next></block></statement><next><block type="actuator_onboard_neopixel_rgb_all" id="jH]|1k|v0*Tqvw}j#@ZP"><value name="RVALUE"><shadow type="math_number" id="[.]}mAPttoXSDLCX(0jA"><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="Du9X9v3R98b/L2/XZVVi"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="d*u1|a!R({5-I6U+eUsV"><field name="NUM">0</field></shadow></value><next><block type="actuator_onboard_neopixel_write" id=")5e1mZM6T=5UaQ6BMhad"><next><block type="controls_delay_new" id="16PP,M*IQg:yy!4]wYvm"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="I^:|uO.Cx/fcp=qwud!C"><field name="NUM">1</field></shadow></value></block></next></block></next></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBvbmJvYXJkX3JnYgppbXBvcnQgdGltZQoKCndoaWxlIFRydWU6CiAgICBmb3IgaSBpbiByYW5nZSgwLCA0LCAxKToKICAgICAgICBvbmJvYXJkX3JnYi5maWxsKCgwLCAwLCAwKSkKICAgICAgICBvbmJvYXJkX3JnYltpXSA9ICgwLCAwLCAyNSkKICAgICAgICBvbmJvYXJkX3JnYi53cml0ZSgpCiAgICAgICAgdGltZS5zbGVlcCgwLjUpCiAgICBvbmJvYXJkX3JnYi5maWxsKCgwLCAwLCAwKSkKICAgIG9uYm9hcmRfcmdiLndyaXRlKCkKICAgIHRpbWUuc2xlZXAoMSkK</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="controls_whileUntil" id="r#pms+8!Op`K`tf#yjYJ" x="-1059" y="-724"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="VCm7X6^jnp2VIh_;X.i#"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="]^~Qj8,3A+Y=ACEdj|B("><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="i9#Jt.hwq_cai/[!)iv?"><value name="btn"><shadow type="pins_button" id="uXi-FWx?(d]i=dyK_6$0"><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO0"><block type="display_show_image" id="[g)aXIaA@9GwPp+.?0rB"><value name="data"><shadow type="pins_builtinimg" id="B$l+hq!bW[o:BnlIEVBx"><field name="PIN">expression_picture.Heart</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="G]nh_i]1jhf9GTlLtRbb"><field name="BOOL">TRUE</field></shadow></value></block></statement><next><block type="controls_if" id="AN=cuSHyp0wn,#e`5)ED"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="Nypyj+ZpvFz{Odc*56=3"><value name="btn"><shadow type="pins_button" id="eGHXC;6ci(Ei.Tmh*5hp"><field name="PIN">B2key</field></shadow></value></block></value><statement name="DO0"><block type="display_clear" id="{A8L`bcW{Es`Z~5]yZ8Q"><value name="boolean"><shadow type="logic_boolean" id="dBRi5VZ6A$lu2I)c8JT3"><field name="BOOL">TRUE</field></shadow></value></block></statement></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1peGdvX25vdmEKZnJvbSBleHByZXNzaW9uX3BpY3R1cmUgaW1wb3J0IEhlYXJ0CmZyb20gbWl4Z29fbm92YSBpbXBvcnQgb25ib2FyZF90ZnQKCndoaWxlIFRydWU6CiAgICBpZiBtaXhnb19ub3ZhLkIxa2V5Lndhc19wcmVzc2VkKCk6CiAgICAgICAgb25ib2FyZF90ZnQuaW1hZ2UoSGVhcnQsIGNvbG9yPTB4ZmZmZixzeW5jPVRydWUpCiAgICBpZiBtaXhnb19ub3ZhLkIya2V5Lndhc19wcmVzc2VkKCk6CiAgICAgICAgb25ib2FyZF90ZnQuZmlsbCgwLHN5bmM9VHJ1ZSkK</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="controls_whileUntil" id="(QU:SrY/4|##PRw;F33N" x="-1437" y="-624"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="8e;-V93UCC|@HDoxOs8L"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="#1H.e{izd;dbYDuZ_kfn"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="@A9c=|*4PKzX!KkxCkT2"><value name="btn"><shadow type="pins_button" id="Q*D893Kv=/{*rRteHnf!"><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO0"><block type="do_while" id="0J,OA3.VxKN$,=$vVuX["><field name="type">true</field><statement name="input_data"><block type="display_show_image" id="LVg2Qv4GPLs6o,*OKrqc"><value name="data"><shadow type="pins_builtinimg" id=":BUM@4gjkluc-57Bdu1n"><field name="PIN">expression_picture.Heart</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="]-Il4OTv#u|cHl6]iOgG"><field name="BOOL">TRUE</field></shadow></value></block></statement><value name="select_data"><block type="sensor_mixgo_button_was_pressed" id="||Dd#dsTa4`W_U,aQ4P9"><value name="btn"><shadow type="pins_button" id=";X(=NC;68i}/:Fcvrs3_"><field name="PIN">B1key</field></shadow></value></block></value><next><block type="display_clear" id="AIQ#]S317l0fv.Ny*kzQ"><value name="boolean"><shadow type="logic_boolean" id="@7xTyEPS:9,szxnvbJFh"><field name="BOOL">TRUE</field></shadow></value></block></next></block></statement></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1peGdvX25vdmEKZnJvbSBleHByZXNzaW9uX3BpY3R1cmUgaW1wb3J0IEhlYXJ0CmZyb20gbWl4Z29fbm92YSBpbXBvcnQgb25ib2FyZF90ZnQKCndoaWxlIFRydWU6CiAgICBpZiBtaXhnb19ub3ZhLkIxa2V5Lndhc19wcmVzc2VkKCk6CiAgICAgICAgd2hpbGUgVHJ1ZToKICAgICAgICAgICAgb25ib2FyZF90ZnQuaW1hZ2UoSGVhcnQsIGNvbG9yPTB4ZmZmZixzeW5jPVRydWUpCiAgICAgICAgICAgIGlmIChtaXhnb19ub3ZhLkIxa2V5Lndhc19wcmVzc2VkKCkpOgogICAgICAgICAgICAgICAgYnJlYWsKICAgICAgICBvbmJvYXJkX3RmdC5maWxsKDAsc3luYz1UcnVlKQo=</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="variables_set" id="sjJUuYiLF),cnPa9n7Rq" x="-1054" y="-758"><field name="VAR">显示</field><value name="VALUE"><block type="logic_boolean" id=")=aIglJ69NIUE_!Ni0`}"><field name="BOOL">FALSE</field></block></value><next><block type="controls_whileUntil" id="OW42W}^xM~7xNbyAYT^,"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="?DCMT*jb$}r}E1DPR}W1"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="SbZmfth_=rA1$bwI!~1."><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="+J[TW[KH~FMJ2#}fgbE2"><value name="btn"><shadow type="pins_button" id="(~K1Z$d!L89e;L41p)8@"><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO0"><block type="variables_set" id="JcxXD]mKGrVc_6JvWvCJ"><field name="VAR">显示</field><value name="VALUE"><block type="logic_negate" id="Bm;rGmz[NK|Cmoa2|D[Y"><value name="BOOL"><block type="variables_get" id="H)2qOX9~X`w[6eJ}Ex@k"><field name="VAR">显示</field></block></value></block></value></block></statement><next><block type="controls_if" id="G;#VmU4blM6[E([m=CQ?"><mutation else="1"></mutation><value name="IF0"><block type="variables_get" id="T,+~702;gYXSll`]JMCB"><field name="VAR">显示</field></block></value><statement name="DO0"><block type="display_show_image" id=".N3Syn+Uuo4S:TOr[2j|"><value name="data"><shadow type="pins_builtinimg" id="^,k;WWF:.k1wbF*Sk7nu"><field name="PIN">expression_picture.Heart</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="/q~=Ans*bQO7wCMIu09w"><field name="BOOL">TRUE</field></shadow></value></block></statement><statement name="ELSE"><block type="display_clear" id="a/C6|Y;yJ6u+#-,!WKOX"><value name="boolean"><shadow type="logic_boolean" id="E6WPWmwzi1arJCG@P^Q]"><field name="BOOL">TRUE</field></shadow></value></block></statement></block></next></block></statement></block></next></block></xml><config>{}</config><code>aW1wb3J0IG1peGdvX25vdmEKZnJvbSBleHByZXNzaW9uX3BpY3R1cmUgaW1wb3J0IEhlYXJ0CmZyb20gbWl4Z29fbm92YSBpbXBvcnQgb25ib2FyZF90ZnQKCuaYvuekuiA9IEZhbHNlCndoaWxlIFRydWU6CiAgICBpZiBtaXhnb19ub3ZhLkIxa2V5Lndhc19wcmVzc2VkKCk6CiAgICAgICAg5pi+56S6ID0gbm90IOaYvuekugogICAgaWYg5pi+56S6OgogICAgICAgIG9uYm9hcmRfdGZ0LmltYWdlKEhlYXJ0LCBjb2xvcj0weGZmZmYsc3luYz1UcnVlKQogICAgZWxzZToKICAgICAgICBvbmJvYXJkX3RmdC5maWxsKDAsc3luYz1UcnVlKQo=</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="controls_whileUntil" id="|lCEN!R}e{M!PsC+UT~L" x="-1669" y="-816"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="uJ+[D:@9Y]7ms:G,v;`."><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="system_print" id="9wTy0Vz*Zw)MB!KY)Fc1"><value name="VAR"><shadow type="text" id="{K`OUEbmcABd!VDMxq_Q"><field name="TEXT">Mixly</field></shadow><block type="sensor_sound" id="jqJSe~|0a9Eori|BMl5x"></block></value><next><block type="controls_delay_new" id="8i]`Fx6x4+N9#i.TRf:b"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="]#/j0xU~}*m|irw(6BQ@"><field name="NUM">0.01</field></shadow></value></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1hY2hpbmUKZnJvbSBtaXhnb19ub3ZhX3ZvaWNlIGltcG9ydCBzb3VuZF9sZXZlbAppbXBvcnQgdGltZQoKCndoaWxlIFRydWU6CiAgICBwcmludChzb3VuZF9sZXZlbCgpKQogICAgdGltZS5zbGVlcCgwLjAxKQo=</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="controls_whileUntil" id="Sud|e@|e~[.CnXM=X?{2" x="94" y="-1"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="!9MnKZI:$t:_jO;mQz`-"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="display_clear" id="h?:Hz3tn_1-1a!~!2NpP"><value name="boolean"><shadow type="logic_boolean" id="A494f6,Mlf3E.-EKbHo}"><field name="BOOL">TRUE</field></shadow></value><next><block type="controls_forEach" id=")2)|}{5JiK7OQ$;=aern"><value name="LIST"><shadow type="list_many_input" id="tlWS4`sU|64+.bvVJb6k"><field name="CONTENT">0,1,2,3</field></shadow><block type="controls_range" id="ymX_OF?a`8e.g}:iqb2J"><value name="FROM"><shadow type="math_number" id="MVQnKGLF`N/@1#Q_hxIf"><field name="NUM">0</field></shadow></value><value name="TO"><shadow type="math_number" id="|xTm[tV-^71)uiEd0O82"><field name="NUM">160</field></shadow></value><value name="STEP"><shadow type="math_number" id="^jPcwgDufj30Mq_.,j[O"><field name="NUM">1</field></shadow></value></block></value><value name="VAR"><shadow type="variables_get" id="~^9NpYWGi-PtZp[+[fpu"><field name="VAR">x</field></shadow></value><statement name="DO"><block type="onboard_tft_display_line" id="JA}r:XL/`nzKRuh672x{"><value name="x1"><shadow type="math_number" id="qu])HkN9~Mc:EH2btL4r"><field name="NUM">0</field></shadow><block type="variables_get" id="94$OZ#N9d(K7[;/kfx|("><field name="VAR">x</field></block></value><value name="y1"><shadow type="math_number" id=";qS@_yT:wp(mwEde7z[b"><field name="NUM">127</field></shadow></value><value name="x2"><shadow type="math_number" id="^7R*`+U=NiD`;]bGEW`:"><field name="NUM">50</field></shadow><block type="variables_get" id="qFLeI,h?HnM/wp,/SyCk"><field name="VAR">x</field></block></value><value name="y2"><shadow type="math_number" id="MNma!@?uMMZHkC.2p81h"><field name="NUM">50</field></shadow><block type="math_arithmetic" id="P=LPN5hZ+l*2ngh!wyqa"><field name="OP">MINUS</field><value name="A"><shadow type="math_number" id="w8I}UMpL2:lfn!L^fZ2i"><field name="NUM">127</field></shadow></value><value name="B"><shadow type="math_number" id=";(=7`Ms+V8?v9]QIefgE"><field name="NUM">1</field></shadow><block type="text_to_number" id="l{o!M$)e[K+t25UfTY;|"><field name="TOWHAT">int</field><value name="VAR"><shadow type="variables_get" id="#pX6tKB$noGeF[^t,Xm5"><field name="VAR">x</field></shadow><block type="math_map" id="4,?B$]ws*~$-:,*tgfUt" inline="false"><value name="NUM"><shadow type="math_number" id="lNuBgU$4-d!F1)Bn@A,@"><field name="NUM">50</field></shadow><block type="sensor_sound" id="LAK]Dlw2a/OnOa!oODX$"></block></value><value name="fromLow"><shadow type="math_number" id="b@bT7tqgR/6-nO;Lq:j="><field name="NUM">0</field></shadow></value><value name="fromHigh"><shadow type="math_number" id="S!1u^7SKxd!#*MfzQ7Y:"><field name="NUM">30000</field></shadow></value><value name="toLow"><shadow type="math_number" id="vge_*-iTexPdSL{*pCv$"><field name="NUM">0</field></shadow></value><value name="toHigh"><shadow type="math_number" id="Bd43hK@0ssf$f!*v2(z^"><field name="NUM">127</field></shadow></value></block></value></block></value></block></value><value name="VAR"><shadow type="tuple_create_with_text_return" id="1iOL=VTyC|/I$.!r2JFF"><field name="TEXT">255,255,0</field></shadow><block type="display_color_seclet" id="KQx:@#lzk`P`oaxmXgzA"><field name="COLOR">#ffffff</field></block></value><value name="boolean"><shadow type="logic_boolean" id="RCLYQ05mVhW):-W[e*Ul"><field name="BOOL">TRUE</field></shadow></value></block></statement></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBvbmJvYXJkX3RmdApmcm9tIG1peGdvX25vdmFfdm9pY2UgaW1wb3J0IHNvdW5kX2xldmVsCmZyb20gbWl4cHkgaW1wb3J0IG1hdGhfbWFwCgp3aGlsZSBUcnVlOgogICAgb25ib2FyZF90ZnQuZmlsbCgwLHN5bmM9VHJ1ZSkKICAgIGZvciB4IGluIHJhbmdlKDAsIDE2MCwgMSk6CiAgICAgICAgb25ib2FyZF90ZnQubGluZSh4LCAxMjcsIHgsICgxMjcgLSBpbnQoKG1hdGhfbWFwKHNvdW5kX2xldmVsKCksIDAsIDMwMDAwLCAwLCAxMjcpKSkpLCAweGZmZmYsc3luYz1UcnVlKQo=</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="controls_whileUntil" id="QL:-f7_hv!aLuQw5!kf^" x="-1518" y="-902"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="(W#I_aQ,|n]f9g+Ja:Q6"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="system_print_many" id="j(Kgnokd0VKR^5Qtz5~6"><mutation items="2"></mutation><value name="ADD0"><block type="sensor_mixgo_nova_LTR308" id="FS3{tqC0KNr3qHm_-T!s"><field name="direction">l</field></block></value><value name="ADD1"><block type="sensor_mixgo_nova_LTR308" id=":c6blXPycF?1?-j]b4}p"><field name="direction">r</field></block></value><next><block type="display_clear" id="~ThKoP@?_kF;sS2^c#o$"><value name="boolean"><shadow type="logic_boolean" id="yb9h1Qe!1NoGTEXD,:a4"><field name="BOOL">TRUE</field></shadow></value><next><block type="onboard_tft_show_image_or_string_delay" id=":7KNF4_eeiw!Yd[~l?{s"><field name="center">True</field><value name="data"><shadow type="text" id="kC2,-0./S,}=eo9zQvtX"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="8WS#34Sobd8b|/RpS1Rn"><value name="VAR"><shadow type="variables_get" id="o+-}4=bpd9huRzYM|x$]"><field name="VAR">x</field></shadow><block type="sensor_mixgo_nova_LTR308" id="C5(?9=qI+J-aPy2!AlbE"><field name="direction">l</field></block></value></block></value><value name="x"><shadow type="math_number" id="abb5_Cv_rhvxe.qbx1v6"><field name="NUM">0</field></shadow></value><value name="y"><shadow type="math_number" id="D|HsyU2a8Q!4)Dw3Ss5r"><field name="NUM">32</field></shadow></value><value name="size"><shadow type="math_number" id="5;O_UBJ:G=_^(mI/@g_5"><field name="NUM">3</field></shadow></value><value name="space"><shadow type="math_number" id="Z:;,,-Ncx!BFz_q6t=*7"><field name="NUM">0</field></shadow></value><value name="VAR"><shadow type="tuple_create_with_text_return" id="2QFd8Qx}c-J!P5(;vFBa"><field name="TEXT">255,255,0</field></shadow><block type="display_color_seclet" id="F!*-7RckFk9Asch=;.}5"><field name="COLOR">#ffffff</field></block></value><value name="boolean"><shadow type="logic_boolean" id="}.hE(gzK.A0D~oNZ)Bz["><field name="BOOL">TRUE</field></shadow></value><next><block type="onboard_tft_show_image_or_string_delay" id="L|Wj8vHz*PwjzJ~S!Zf-"><field name="center">True</field><value name="data"><shadow type="text" id="{7GsaSZKqlL?i_vz^2[9"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id=".ox/$(*C?s.~tg+qF.1y"><value name="VAR"><shadow type="variables_get" id="{XmOuM+Nq{2@sgl-X+z~"><field name="VAR">x</field></shadow><block type="sensor_mixgo_nova_LTR308" id="jLzf{KDDwtx+va?5baeI"><field name="direction">r</field></block></value></block></value><value name="x"><shadow type="math_number" id="=f=AS,23,/At;@04*:7J"><field name="NUM">0</field></shadow></value><value name="y"><shadow type="math_number" id="qA9dBanXB`g!Q*097=Sa"><field name="NUM">80</field></shadow></value><value name="size"><shadow type="math_number" id="a`]`]p}(IR~w^,HYw6Tx"><field name="NUM">3</field></shadow></value><value name="space"><shadow type="math_number" id="-mG|d/;Ne^w_,u9uLIB}"><field name="NUM">0</field></shadow></value><value name="VAR"><shadow type="tuple_create_with_text_return" id="laF8ZLzxK(j0txm}-Yu]"><field name="TEXT">255,255,0</field></shadow><block type="display_color_seclet" id="cGDP(-!#W7`Y{Qt$0FJJ"><field name="COLOR">#ffffff</field></block></value><value name="boolean"><shadow type="logic_boolean" id="1.w*USQWn+n~a;)69ig!"><field name="BOOL">TRUE</field></shadow></value><next><block type="controls_delay_new" id="Ydf_Um+@YHz)+Y[r2sk3"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="w0J0CJm_m!ot4CFyLU_b"><field name="NUM">0.1</field></shadow></value></block></next></block></next></block></next></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBvbmJvYXJkX2Fsc19sCmZyb20gbWl4Z29fbm92YSBpbXBvcnQgb25ib2FyZF9hbHNfcgpmcm9tIG1peGdvX25vdmEgaW1wb3J0IG9uYm9hcmRfdGZ0CmltcG9ydCB0aW1lCgp3aGlsZSBUcnVlOgogICAgcHJpbnQob25ib2FyZF9hbHNfbC5hbHNfdmlzKCksIG9uYm9hcmRfYWxzX3IuYWxzX3ZpcygpKQogICAgb25ib2FyZF90ZnQuZmlsbCgwLHN5bmM9VHJ1ZSkKICAgIG9uYm9hcmRfdGZ0LnNob3dzKHN0cihvbmJvYXJkX2Fsc19sLmFsc192aXMoKSksIHg9MCwgeT0zMiwgc2l6ZT0zLCBzcGFjZT0wLCBjZW50ZXI9VHJ1ZSwgY29sb3I9MHhmZmZmLHN5bmM9VHJ1ZSkKICAgIG9uYm9hcmRfdGZ0LnNob3dzKHN0cihvbmJvYXJkX2Fsc19yLmFsc192aXMoKSksIHg9MCwgeT04MCwgc2l6ZT0zLCBzcGFjZT0wLCBjZW50ZXI9VHJ1ZSwgY29sb3I9MHhmZmZmLHN5bmM9VHJ1ZSkKICAgIHRpbWUuc2xlZXAoMC4xKQo=</code>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="variables_set" id="nbW*Fy3N?VCy22]n`zO0" x="-1538" y="-819"><field name="VAR">接近距离</field><value name="VALUE"><block type="math_number" id="qX#i,AOSViqC0JejPY*["><field name="NUM">0</field></block></value><next><block type="controls_whileUntil" id="s=~==}^p4JEXZ;|CuE#6"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="a}*RrJx1)H)fScUoI}m!"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="variables_set" id="e:B_e,X_#w6q33ZG;dp8"><field name="VAR">接近距离</field><value name="VALUE"><block type="text_to_number" id="QFOTlJcaMJI4NoX.dSiT"><field name="TOWHAT">int</field><value name="VAR"><shadow type="variables_get" id="a*pYswjtZb8^B^om4hmk"><field name="VAR">x</field></shadow><block type="sensor_mixgo_nova_pin_near" id="D[~}_h/YgEoX0o$K;0xf"><field name="direction">l</field></block></value></block></value><next><block type="system_print" id="j0@MvnUn@Djd[[G`fA_0"><value name="VAR"><shadow type="text" id="kwU{;s}=(1bDy}eXvi21"><field name="TEXT">Mixly</field></shadow><block type="variables_get" id="Fka+X#Z+K~CrQ}(n/3@-"><field name="VAR">接近距离</field></block></value><next><block type="display_show_image_or_string_delay" id="ly7Bh;1lABX}KWh0@w,i"><field name="center">True</field><value name="data"><shadow type="text" id="f=0c)TJ?yMwG_QSMX8)@"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="$opK?8^ct*-0oY:uinjk"><value name="VAR"><shadow type="variables_get" id="y.4U1fUEco9eW(.5@Rv/"><field name="VAR">x</field></shadow><block type="variables_get" id="=F*vd;WX+8K9OHeN(^5b"><field name="VAR">接近距离</field></block></value></block></value><value name="space"><shadow type="math_number" id="9~18K_{Aj*CPkasAXaF~"><field name="NUM">0</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="R1ZXN{9|{Aps]@Q|~oPy"><field name="BOOL">TRUE</field></shadow></value><next><block type="controls_delay_new" id="(nT/_dOjFfU]$PH=SAV6"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="=TsU7Tb3zQKqW|Mtb/Tf"><field name="NUM">1</field></shadow></value></block></next></block></next></block></next></block></statement></block></next></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBvbmJvYXJkX2Fsc19sCmltcG9ydCBtYWNoaW5lCmZyb20gbWl4Z29fbm92YSBpbXBvcnQgb25ib2FyZF90ZnQKaW1wb3J0IHRpbWUKCuaOpei/kei3neemuyA9IDAKd2hpbGUgVHJ1ZToKICAgIOaOpei/kei3neemuyA9IGludChvbmJvYXJkX2Fsc19sLnBzX25sKCkpCiAgICBwcmludCjmjqXov5Hot53nprspCiAgICBvbmJvYXJkX3RmdC5zaG93cyhzdHIo5o6l6L+R6Led56a7KSwgc3BhY2U9MCwgY2VudGVyPVRydWUsc3luYz1UcnVlKQogICAgdGltZS5zbGVlcCgxKQo=</code>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="controls_whileUntil" id="DE+f8JI6{q;MuSDp/ll@" x="-1405" y="-729"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="G;q=!FhR{PN=XK+us7z1"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="system_print" id="Zb,gSmvlW8k`BV+]uhrL"><value name="VAR"><shadow type="text" id="|]pWS4[KIZ^j@^w0sb_["><field name="TEXT">Mixly</field></shadow><block type="sensor_get_acceleration" id="4WfETdn7|]|ZNC=v[6DZ"><field name="key"></field></block></value><next><block type="controls_delay_new" id="}d#meZhELfV#0|lO752v"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="bv-xA^lC6qsB)ft/W!np"><field name="NUM">1</field></shadow></value></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1hY2hpbmUKZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBvbmJvYXJkX2FjYwppbXBvcnQgdGltZQoKCndoaWxlIFRydWU6CiAgICBwcmludChvbmJvYXJkX2FjYy5hY2NlbGVyYXRpb24oKSkKICAgIHRpbWUuc2xlZXAoMSkK</code>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="controls_whileUntil" id="_4/Ewzo`+/9W1{XuYlB/" x="-1881" y="-819"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="jd]Wu~6fIaZ3d}(x*}av"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="onboard_tft_show_image_or_string_delay" id="vu{6T56I1{/I=YP$B7~U"><field name="center">True</field><value name="data"><shadow type="text" id="[b9?i/lEC_Gun1gZSO72"><field name="TEXT">Mixly</field></shadow><block type="text_join" id="9K/nIg(b4/2h0j_7_ZX7"><value name="A"><shadow type="text" id="*G:HPT7)IJA[BGnV;X=n"><field name="TEXT">温度:</field></shadow></value><value name="B"><shadow type="text" id="Ht_}Z2+#T_JJSK1zruUH"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="YT}phh*jj@{LRK[r/wuq"><value name="VAR"><shadow type="variables_get" id=":e24B=bq[UJ*tMLn:[@a"><field name="VAR">x</field></shadow><block type="text_to_number" id="EfcUXZOOZv.aQgM`y{eg"><field name="TOWHAT">int</field><value name="VAR"><shadow type="variables_get" id="P~m}KQtt}0KL]N,Wc3nJ"><field name="VAR">x</field></shadow><block type="sensor_aht11" id="oNA,{QIKxQ:],V?tUGKT"><field name="key">temperature</field></block></value></block></value></block></value></block></value><value name="x"><shadow type="math_number" id="oH$E7UohaQ-0KCD-~Pd-"><field name="NUM">0</field></shadow></value><value name="y"><shadow type="math_number" id="7]+;.}$X}r#hU7aaR(N0"><field name="NUM">32</field></shadow></value><value name="size"><shadow type="math_number" id="{lqszX2:v$]d)CaG_:rm"><field name="NUM">2</field></shadow></value><value name="space"><shadow type="math_number" id="g,cnom#|Z#|Wt7B]T]Fs"><field name="NUM">0</field></shadow></value><value name="VAR"><shadow type="tuple_create_with_text_return" id="O80,iI|*]/0QRFi66kk,"><field name="TEXT">255,255,0</field></shadow><block type="display_color_seclet" id="M2ZGk4w(m#2INJq+Z0+d"><field name="COLOR">#ffffff</field></block></value><value name="boolean"><shadow type="logic_boolean" id="[a^oNte+:[DDOel|8wMq"><field name="BOOL">TRUE</field></shadow></value><next><block type="onboard_tft_show_image_or_string_delay" id="Pq#ucWH#I#L+$px1)xk;"><field name="center">True</field><value name="data"><shadow type="text" id="=b0r4iw$,UR2]pu$7+kB"><field name="TEXT">Mixly</field></shadow><block type="text_join" id="tELW_ENzB:F^|04,=DBd"><value name="A"><shadow type="text" id="~J.T6Y{-~3Er/UG8L-,T"><field name="TEXT">湿度:</field></shadow></value><value name="B"><shadow type="text" id="P0VXV}-dy1Fn)aJ1pcK9"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="W6*!:m$!)|m+ybGdRxg#"><value name="VAR"><shadow type="variables_get" id="0y@MsQ5+[k?a^$u*zGME"><field name="VAR">x</field></shadow><block type="text_to_number" id="]][=LUK9RaA^=$y?0JaM"><field name="TOWHAT">int</field><value name="VAR"><shadow type="variables_get" id="P.@62Q/4+neH|oKd(~`d"><field name="VAR">x</field></shadow><block type="sensor_aht11" id="fPzFa(r}Q[xXjM#`*0Q("><field name="key">humidity</field></block></value></block></value></block></value></block></value><value name="x"><shadow type="math_number" id="fM@Du1w$q6;3@^P/l+DG"><field name="NUM">0</field></shadow></value><value name="y"><shadow type="math_number" id="1MNV@u]q$[fNG9{@dtTt"><field name="NUM">64</field></shadow></value><value name="size"><shadow type="math_number" id="PbCkGEy2[0!NQahgXF`Q"><field name="NUM">2</field></shadow></value><value name="space"><shadow type="math_number" id="LQNySu@C8J`m21,U[CqW"><field name="NUM">0</field></shadow></value><value name="VAR"><shadow type="tuple_create_with_text_return" id=":L37!`)nZ|c:buA1[KRE"><field name="TEXT">255,255,0</field></shadow><block type="display_color_seclet" id=":CDLfEj,5o64Tfv#FiK@"><field name="COLOR">#ffffff</field></block></value><value name="boolean"><shadow type="logic_boolean" id="a*:^l~~^fb:ArNeXWi4B"><field name="BOOL">TRUE</field></shadow></value><next><block type="controls_delay_new" id="dTi)}Xqb`Xp.XMB}@!,K"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="0$N6#L.nB^ePP{cv`b-8"><field name="NUM">1</field></shadow></value></block></next></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBvbmJvYXJkX3RmdApmcm9tIG1peGdvX25vdmEgaW1wb3J0IG9uYm9hcmRfdGhzCmltcG9ydCB0aW1lCgp3aGlsZSBUcnVlOgogICAgb25ib2FyZF90ZnQuc2hvd3MoJ+a4qeW6pjonICsgc3RyKGludChvbmJvYXJkX3Rocy50ZW1wZXJhdHVyZSgpKSksIHg9MCwgeT0zMiwgc2l6ZT0yLCBzcGFjZT0wLCBjZW50ZXI9VHJ1ZSwgY29sb3I9MHhmZmZmLHN5bmM9VHJ1ZSkKICAgIG9uYm9hcmRfdGZ0LnNob3dzKCfmub/luqY6JyArIHN0cihpbnQob25ib2FyZF90aHMuaHVtaWRpdHkoKSkpLCB4PTAsIHk9NjQsIHNpemU9Miwgc3BhY2U9MCwgY2VudGVyPVRydWUsIGNvbG9yPTB4ZmZmZixzeW5jPVRydWUpCiAgICB0aW1lLnNsZWVwKDEpCg==</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="controls_whileUntil" id="f!^qzmqS!z,3AT[,ipZ/" x="-1833" y="-789"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="K1a:Ukw_4l6`1_iZ}bcN"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="display_show_image_or_string_delay" id="O}pnRv,-k31T|Lq}@_6~"><field name="center">True</field><value name="data"><shadow type="text" id="j|JHQd}p8TCc|W1HSo@M"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="*)1sQU+[`q}}cac8:[-F"><value name="VAR"><shadow type="variables_get" id="IJ[R(GwcgY6Ekh-d.OPA"><field name="VAR">x</field></shadow><block type="sensor_mixgo_cc_mmc5603_get_magnetic" id="^6zY;||W[Q?*Eve$My2u"><field name="key">all</field></block></value></block></value><value name="space"><shadow type="math_number" id="LA*KOFf_I|7^vCp;@D*("><field name="NUM">0</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="BoP0b`|al{piTPhoa|h2"><field name="BOOL">TRUE</field></shadow></value><next><block type="controls_if" id="I.*.,gZ@J2h+2u(W8q#J"><value name="IF0"><block type="logic_compare" id="R.#z?[Pu7;Ul~CVo4RUb"><field name="OP">GT</field><value name="A"><block type="sensor_mixgo_cc_mmc5603_get_magnetic" id="+#RF8vo?l593d?Q(k#JN"><field name="key">all</field></block></value><value name="B"><block type="math_number" id="IShRJP[w]lmVOR.Rd}tR"><field name="NUM">2000</field></block></value></block></value><statement name="DO0"><block type="esp32_onboard_music_pitch_with_time" id="oshvKAG]QHsec-`8,+QP"><value name="pitch"><shadow type="pins_tone_notes" id="H.K$L~p;o++ZnP=:7q3a"><field name="PIN">659</field></shadow></value><value name="time"><shadow type="math_number" id="jX8}@;YT_CtI+V]h*c]4"><field name="NUM">100</field></shadow></value></block></statement></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBvbmJvYXJkX21ncwpmcm9tIG1peGdvX25vdmEgaW1wb3J0IG9uYm9hcmRfdGZ0CmZyb20gbWl4Z29fbm92YV92b2ljZSBpbXBvcnQgc3BrX21pZGkKCndoaWxlIFRydWU6CiAgICBvbmJvYXJkX3RmdC5zaG93cyhzdHIob25ib2FyZF9tZ3MuZ2V0c3RyZW5ndGgoKSksIHNwYWNlPTAsIGNlbnRlcj1UcnVlLHN5bmM9VHJ1ZSkKICAgIGlmIG9uYm9hcmRfbWdzLmdldHN0cmVuZ3RoKCkgPiAyMDAwOgogICAgICAgIHNwa19taWRpLnBpdGNoX3RpbWUoNjU5LCAxMDApCg==</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="controls_whileUntil" id=",Sx|B!rFM9:*gHnk{NaP" x="-1881" y="-819"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="CthpYIKi(OM-B0ftff(?"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="actuator_onboard_neopixel_rgb" id="T_H,Cy-Zg?DK~{a)SNu,"><value name="_LED_"><shadow type="math_number" id="Pwl:U?5?0cd0FO][oMur"><field name="NUM">0</field></shadow></value><value name="RVALUE"><shadow type="math_number" id="CzOIY3jIss5YqQ*=+aO]"><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="3G^bjHAf|jpG:]Y_Mf#0"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="SSZ{i@9[oX/J_C`(;SwR"><field name="NUM">0</field></shadow><block type="math_arithmetic" id="d[D)N}$jl~e2rxu7ilwt"><field name="OP">MULTIPLY</field><value name="A"><shadow type="math_number" id="9=yFWFXR_?L.Og:^vdH4"><field name="NUM">20</field></shadow></value><value name="B"><shadow type="math_number" id="se?].o}QHPD~0Gv8G|E|"><field name="NUM">1</field></shadow><block type="sensor_mixgoce_pin_pressed" id="$Us,|BT!xtGGQy0!GDyl"><value name="button"><shadow type="number6" id="E$?rcuAjY3A~^~mH3|EC"><field name="op">3</field></shadow></value></block></value></block></value><next><block type="actuator_onboard_neopixel_rgb" id="?W?3C4$st]1DyG:dk?Zd"><value name="_LED_"><shadow type="math_number" id="LdDj|k^mxjoFuVrujTMN"><field name="NUM">1</field></shadow></value><value name="RVALUE"><shadow type="math_number" id="+uEDg3INu~|~9/zIz@;="><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="UU8s(^@14:7bxrLeez;m"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="!WNO{{|OVGHB@Q0F=A-q"><field name="NUM">0</field></shadow><block type="math_arithmetic" id=":hq^MPUDhQaVgEo64s(b"><field name="OP">MULTIPLY</field><value name="A"><shadow type="math_number" id="do:@]ZntQC^_$-fVAseM"><field name="NUM">20</field></shadow></value><value name="B"><shadow type="math_number" id="pQ5}Kta!qSjwm]`[C(N_"><field name="NUM">1</field></shadow><block type="sensor_mixgoce_pin_pressed" id="#U$:e|EwNmVKv*4M5X[2"><value name="button"><shadow type="number6" id="oV]{f_SkWcl`7c0rl5hR"><field name="op">4</field></shadow></value></block></value></block></value><next><block type="actuator_onboard_neopixel_write" id="(C*JVERL#Ei.*oRrjsm$"></block></next></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBvbmJvYXJkX3JnYgppbXBvcnQgbWl4Z29fbm92YQoKCndoaWxlIFRydWU6CiAgICBvbmJvYXJkX3JnYlswXSA9ICgwLCAwLCAoMjAgKiBtaXhnb19ub3ZhLnRvdWNoZWQoMykpKQogICAgb25ib2FyZF9yZ2JbMV0gPSAoMCwgMCwgKDIwICogbWl4Z29fbm92YS50b3VjaGVkKDQpKSkKICAgIG9uYm9hcmRfcmdiLndyaXRlKCkK</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="controls_whileUntil" id="}Ujg,_#rQ.f7YJJE^X17" x="-1881" y="-819"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="VMsinxnc8Ogxu;26!}#]"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="system_print" id="S?ojl]{^*|i[e3m^(Fbs"><value name="VAR"><shadow type="text" id="BB*l0ya{+TCJ[wZ?W2MA"><field name="TEXT">Mixly</field></shadow><block type="sensor_mixgo_touch_slide" id="7vTD6czk|EYB|f{(R~3Z"></block></value><next><block type="actuator_onboard_neopixel_rgb" id="Vg-688f^LFnvebfaF0Tx"><value name="_LED_"><shadow type="math_number" id="A~Q+:r/evgMx$.mRHaVD"><field name="NUM">0</field></shadow></value><value name="RVALUE"><shadow type="math_number" id="3Y`4Zgnfd(c@B9-P2{F("><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="/++-L0;M0WFw.IlJnx:U"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="T8t+7nQ2wrVC`!o5$kxl"><field name="NUM">0</field></shadow><block type="math_to_int" id="K2-En+,doM_7lkS90[Cp"><field name="OP">round</field><value name="A"><shadow type="math_number" id="}efw?,cCZ=lCeN+;:wMf"><field name="NUM">0.998</field></shadow><block type="math_map" id="kOlJeQkzb`5*z||ox-uU"><value name="NUM"><shadow type="math_number" id="pW`,~=Vewbq76jY!^{+X"><field name="NUM">50</field></shadow><block type="sensor_mixgo_touch_slide" id="$t]gzB#p{.O2gOW)B$J0"></block></value><value name="fromLow"><shadow type="math_number" id="*xmF`q`G*z3;)S|lI-4;"><field name="NUM">-15000</field></shadow></value><value name="fromHigh"><shadow type="math_number" id="-s=01}Doi]_dUyIR23CO"><field name="NUM">0</field></shadow></value><value name="toLow"><shadow type="math_number" id="1METGzth/FLJ$R|S!n0k"><field name="NUM">255</field></shadow></value><value name="toHigh"><shadow type="math_number" id="60vQl~v9n.j*}/2rqH-Y"><field name="NUM">0</field></shadow></value></block></value></block></value><next><block type="actuator_onboard_neopixel_rgb" id="rdF`X;#}.r,aeetSgley"><value name="_LED_"><shadow type="math_number" id="$oKEb.[59NDxDB]|n6_X"><field name="NUM">1</field></shadow></value><value name="RVALUE"><shadow type="math_number" id="SL9);TxIy?SE/NuL_yi6"><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="!$U:V!Rr9$ju[#z#rsfC"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="TL_-,/SS6@w_zlO,6v]O"><field name="NUM">0</field></shadow><block type="math_to_int" id="S~W9hmi|P,WHvoC`pncG"><field name="OP">round</field><value name="A"><shadow type="math_number" id="~rUZBuu;BxTCdHkF4SmW"><field name="NUM">0.998</field></shadow><block type="math_map" id="Z2TShzL?)?ZOt|ujd6dx"><value name="NUM"><shadow type="math_number" id="2DHyzrwMU#,!5Eemf9n8"><field name="NUM">50</field></shadow><block type="sensor_mixgo_touch_slide" id="GT{5sk-U}/v4QpwOYe5g"></block></value><value name="fromLow"><shadow type="math_number" id="]:K7j4/ZYGJc8iL;6VB+"><field name="NUM">0</field></shadow></value><value name="fromHigh"><shadow type="math_number" id="#{7bVuW~4h@7i.PNWrL|"><field name="NUM">15000</field></shadow></value><value name="toLow"><shadow type="math_number" id="@kV#91{Ei!pz.:t~mxh7"><field name="NUM">0</field></shadow></value><value name="toHigh"><shadow type="math_number" id="#qV)$X.P;gzWmEe1ufka"><field name="NUM">255</field></shadow></value></block></value></block></value><next><block type="actuator_onboard_neopixel_write" id="R82Q$Y+BpM=[P$,Rk~(q"></block></next></block></next></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1hY2hpbmUKaW1wb3J0IG1peGdvX25vdmEKZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBvbmJvYXJkX3JnYgpmcm9tIG1peHB5IGltcG9ydCBtYXRoX21hcAoKCndoaWxlIFRydWU6CiAgICBwcmludChtaXhnb19ub3ZhLnRvdWNoX3NsaWRlKDMsIDQpKQogICAgb25ib2FyZF9yZ2JbMF0gPSAoMCwgMCwgcm91bmQobWF0aF9tYXAobWl4Z29fbm92YS50b3VjaF9zbGlkZSgzLCA0KSwgKC0xNTAwMCksIDAsIDI1NSwgMCkpKQogICAgb25ib2FyZF9yZ2JbMV0gPSAoMCwgMCwgcm91bmQobWF0aF9tYXAobWl4Z29fbm92YS50b3VjaF9zbGlkZSgzLCA0KSwgMCwgMTUwMDAsIDAsIDI1NSkpKQogICAgb25ib2FyZF9yZ2Iud3JpdGUoKQo=</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="onboard_RTC_settime_string" id="p~]Jr-Q-YbG:_gwEYi5U" x="-2057" y="-1012"><value name="CONTENT"><shadow type="tuple_input" id="yj=eklq1tF/MIz9Kk|!S"><field name="CONTENT">2025,3,25,16,28,27</field></shadow></value><next><block type="controls_whileUntil" id="iV@iSux{eY5q4)w05o!q"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="Zyjrx]v:)W=S*+a-!Gv2"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="system_print" id=",M:J0)`,@0I5e/-u3_re"><value name="VAR"><shadow type="text" id="XmIpA$ZHMg/pSVZhxeqb"><field name="TEXT">Mixly</field></shadow><block type="onboard_RTC_get_time" id="8uaH|*CHz,a`8njqQBEP"></block></value><next><block type="display_show_image_or_string_delay" id="VMlDd}6G`U5L=+xZ)gWm"><field name="center">True</field><value name="data"><shadow type="text" id="oD30aU:jO=T`E2pjx#1j"><field name="TEXT">Mixly</field></shadow><block type="onboard_RTC_get_time_str" id="HXb=Zka@(SS5Cofmfw`v"></block></value><value name="space"><shadow type="math_number" id="=CU8Pc9)KmM]Amrhg!5o"><field name="NUM">0</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id=")a`$skCR+HDrmOauiF:!"><field name="BOOL">TRUE</field></shadow></value><next><block type="controls_delay_new" id="V,TWczfsN}mGevx+wT?)"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="x}]EELUS6RU=NjZrc]Xl"><field name="NUM">1</field></shadow></value></block></next></block></next></block></statement></block></next></block></xml><config>{}</config><code>aW1wb3J0IHJ0Y3RpbWUKaW1wb3J0IG1hY2hpbmUKaW1wb3J0IHRpbWUKZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBvbmJvYXJkX3RmdAoKcnRjdGltZS5zZXR0aW1lKCgyMDI1LDMsMjUsMTYsMjgsMjcpKQp3aGlsZSBUcnVlOgogICAgcHJpbnQodGltZS5sb2NhbHRpbWUoKSkKICAgIG9uYm9hcmRfdGZ0LnNob3dzKHJ0Y3RpbWUuc3RydGltZSgpLCBzcGFjZT0wLCBjZW50ZXI9VHJ1ZSxzeW5jPVRydWUpCiAgICB0aW1lLnNsZWVwKDEpCg==</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="onboard_tft_clock_init" id="69=FGU}dO2[`c3sL}7fh" x="-2454" y="-855"><value name="SUB"><shadow type="variables_get" id="wvsD`[i1+/AVNBR18Ms$"><field name="VAR">new_clock</field></shadow></value><value name="x"><shadow type="math_number" id="PcFg7B?ZbRPU|/Xv(bY)"><field name="NUM">80</field></shadow></value><value name="y"><shadow type="math_number" id="9W4@#Ew-51H/|]`?BHKz"><field name="NUM">64</field></shadow></value><value name="size"><shadow type="math_number" id="#=5aSq84`dj=G#@,/_8-"><field name="NUM">40</field></shadow></value><value name="VAR"><shadow type="tuple_create_with_text_return" id="s6Ly|2IqQ[O798U^BRb,"><field name="TEXT">255,255,0</field></shadow><block type="display_color_seclet" id="_`szqzy9.;Gfr|A]HnJN"><field name="COLOR">#ffffff</field></block></value><next><block type="onboard_RTC_settime_string" id="QCC3![C/iI:U95c0{+vu"><value name="CONTENT"><shadow type="tuple_input" id="q:z7:D5+:1{`$#LdK[R#"><field name="CONTENT">2025,3,25,16,29,13</field></shadow></value><next><block type="controls_whileUntil" id="P-51A}z+tK:n;/bbhce6"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="zF($+K;s~+,+YfXz?$Vn"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="onboard_tft_clock_get_rtctime" id="QHvi@S/7PAF,dP+yil;W"><value name="SUB"><shadow type="variables_get" id="#:vSBSbvtL{Dul5I[EXo"><field name="VAR">new_clock</field></shadow></value><next><block type="onboard_tft_clock_clear" id="`*[}`NaHo6UyriOf|{Wi"><value name="SUB"><shadow type="variables_get" id="Uo;0J9=-@1{sk6|Ym]AC"><field name="VAR">new_clock</field></shadow></value><value name="VAR"><shadow type="tuple_create_with_text_return" id="@48K6SBB|e|DpLzGmJA#"><field name="TEXT">0,0,0</field></shadow><block type="display_color_seclet" id="jh$D,//Y=llI9LWj1Sy6"><field name="COLOR">#000000</field></block></value><next><block type="onboard_tft_clock_draw" id="f,F4Nsq#MK=4zfSoqIL6"><value name="SUB"><shadow type="variables_get" id="7pfbQC#5:P:yLA^,WO4+"><field name="VAR">new_clock</field></shadow></value><next><block type="controls_delay_new" id="!469opJn|$4VC9#SlJhb"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id=";9Ps.T-Glx4V?04.ITRJ"><field name="NUM">1</field></shadow></value></block></next></block></next></block></next></block></statement></block></next></block></next></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBDbG9jawppbXBvcnQgcnRjdGltZQppbXBvcnQgdGltZQoKCm5ld19jbG9jaz1DbG9jayg4MCwgNjQsIDQwLCAweGZmZmYpCnJ0Y3RpbWUuc2V0dGltZSgoMjAyNSwzLDI1LDE2LDI5LDEzKSkKd2hpbGUgVHJ1ZToKICAgIG5ld19jbG9jay5zZXRfcnRjdGltZSgpCiAgICBuZXdfY2xvY2suY2xlYXIoMHgwKQogICAgbmV3X2Nsb2NrLmRyYXdfY2xvY2soKQogICAgdGltZS5zbGVlcCgxKQo=</code>"><shadow type="math_number" id=")0)fL:R3Ydz)y}SH|mtu"><field name="NUM">1</field></shadow></value></block></next></block></next></block></next></block></statement></block></next></block></next></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBDbG9jawppbXBvcnQgbnRwdGltZQppbXBvcnQgdGltZQoKCm5ld19jbG9jaz1DbG9jayg4MCw2NCw0MCwweGZmZmYpCm50cHRpbWUuc2V0dGltZSgoMjAyNCw0LDIsMjEsMDQsNDUsMCwwKSkKd2hpbGUgVHJ1ZToKICAgIG5ld19jbG9jay5zZXRfcnRjdGltZSgpCiAgICBuZXdfY2xvY2suY2xlYXIoMHgwKQogICAgbmV3X2Nsb2NrLmRyYXdfY2xvY2soKQogICAgdGltZS5zbGVlcCgxKQo=</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="variables_set" id="y={4xEft#cz0bp8N^`.2" x="-2314" y="-914"><field name="VAR">按下时刻</field><value name="VALUE"><block type="math_number" id="Jw{GEPBV!$v9{7f.b;;5"><field name="NUM">0</field></block></value><next><block type="variables_set" id="Kp@@}B7[f2()~,n~dtG_"><field name="VAR">抬起时刻</field><value name="VALUE"><block type="math_number" id="c]dxpMJr?}Ggi](@3iHh"><field name="NUM">0</field></block></value><next><block type="controls_whileUntil" id="3ka2w:eRORl]U}Xxs1yU"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="n^iv`UjEoz[l4rcvaa$0"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="mlI4pO8|z@HZm3$~;d@#"><value name="IF0"><block type="sensor_mixgo_button_is_pressed" id="9~l}c[RFb?aTM8[GC+V2"><value name="btn"><shadow type="pins_button" id="^@;p]HC6YSUhj#NZiKl+"><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO0"><block type="variables_set" id="o4RwgFjks2g;VrMSH?3O"><field name="VAR">按下时刻</field><value name="VALUE"><block type="controls_millis" id="*.zr?4bmUPIQDHG!I_ys"><field name="Time">ms</field></block></value><next><block type="do_while" id="3j_yu^1$UyX)UYqSv+)d"><field name="type">true</field><value name="select_data"><block type="logic_negate" id="uAHZ4Uw)`e93YH$^LoJt"><value name="BOOL"><block type="sensor_mixgo_button_is_pressed" id="!tS+02xBi_SV2ShXF0}~"><value name="btn"><shadow type="pins_button" id="^:b;1c[#[(V65EpZ,{h3"><field name="PIN">B1key</field></shadow></value></block></value></block></value><next><block type="variables_set" id="JA$Bs$ji[H}QBV(yA8y2"><field name="VAR">抬起时刻</field><value name="VALUE"><block type="controls_millis" id="AV}ON{4PqSWCw-LPQ`+A"><field name="Time">ms</field></block></value><next><block type="system_print" id="8`ydu+6c4;ANdI`0V-`J"><value name="VAR"><shadow type="text" id="_0`M3Mvcm48St#$J4$;K"><field name="TEXT">Mixly</field></shadow><block type="math_arithmetic" id="T@)=63wW0W0.SmYgLXo{"><field name="OP">MINUS</field><value name="A"><shadow type="math_number" id="rvU.6/Q_njFv-,~91jVF"><field name="NUM">1</field></shadow><block type="variables_get" id="Gt5s2]}B7:`2njV?nB29"><field name="VAR">抬起时刻</field></block></value><value name="B"><shadow type="math_number" id="!E;fc}FmQ:9lO4-,-y{:"><field name="NUM">1</field></shadow><block type="variables_get" id="[@hFUO(qE`i;}Xctnp.E"><field name="VAR">按下时刻</field></block></value></block></value><next><block type="display_show_image_or_string_delay" id="(MQg3:.wQa#V;(e,Tc0_"><field name="center">True</field><value name="data"><shadow type="text" id="~56*;QshXLWGu}n0Bex["><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="Yez0l~P8Q#O1Yz2RB+#C"><value name="VAR"><shadow type="variables_get" id="Xq9(y)z@(IjEfAc#de1R"><field name="VAR">x</field></shadow><block type="math_arithmetic" id="@^f~q7ES40LFC+$~E($="><field name="OP">MINUS</field><value name="A"><shadow type="math_number" id="-*uVrkAUGS+^7.6F=a*?"><field name="NUM">1</field></shadow><block type="variables_get" id="*QaarpC/qFDgi:c?nEGs"><field name="VAR">抬起时刻</field></block></value><value name="B"><shadow type="math_number" id="Xv]Z77M2c!w8O1KuEN*?"><field name="NUM">1</field></shadow><block type="variables_get" id="]Z~z)~H^`UokJ5x]-v@$"><field name="VAR">按下时刻</field></block></value></block></value></block></value><value name="space"><shadow type="math_number" id="qjuxqxw]8dB*03DLXFI1"><field name="NUM">0</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="H8FgR1-c[;tx[;eNWNIl"><field name="BOOL">TRUE</field></shadow></value></block></next></block></next></block></next></block></next></block></statement></block></statement></block></next></block></next></block></xml><config>{}</config><code>aW1wb3J0IG1peGdvX25vdmEKaW1wb3J0IHRpbWUKaW1wb3J0IG1hY2hpbmUKZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBvbmJvYXJkX3RmdAoK5oyJ5LiL5pe25Yi7ID0gMArmiqzotbfml7bliLsgPSAwCndoaWxlIFRydWU6CiAgICBpZiBtaXhnb19ub3ZhLkIxa2V5LmlzX3ByZXNzZWQoKToKICAgICAgICDmjInkuIvml7bliLsgPSB0aW1lLnRpY2tzX21zKCkKICAgICAgICB3aGlsZSBUcnVlOgogICAgICAgICAgICBpZiAobm90IG1peGdvX25vdmEuQjFrZXkuaXNfcHJlc3NlZCgpKToKICAgICAgICAgICAgICAgIGJyZWFrCiAgICAgICAg5oqs6LW35pe25Yi7ID0gdGltZS50aWNrc19tcygpCiAgICAgICAgcHJpbnQoKOaKrOi1t+aXtuWIuyAtIOaMieS4i+aXtuWIuykpCiAgICAgICAgb25ib2FyZF90ZnQuc2hvd3Moc3RyKCjmiqzotbfml7bliLsgLSDmjInkuIvml7bliLspKSwgc3BhY2U9MCwgY2VudGVyPVRydWUsc3luYz1UcnVlKQo=</code>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="controls_whileUntil" id="G[@Y;1ni_Tj;#kZ#bI+n" x="-3056" y="-956"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="Yw$:_(S^G}U2D1+r5n+Z"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="actuator_led_bright" id="a^ZjB34g80quX!.gJh[A"><value name="led"><shadow type="number" id="#11A8Kg*Yy3+KC8[ZTxm"><field name="op">2</field></shadow></value><value name="bright"><shadow type="ledswitch" id="2$H9vzcTy(jF6R5{@@EA"><field name="flag">1</field></shadow></value><next><block type="controls_delay_new" id="RrT^k)Cubui|9XV1f@Cx"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="M?*`aw$j-$9soK5?i$vv"><field name="NUM">0.5</field></shadow></value><next><block type="actuator_led_bright" id="aw:Gi#S1N?|ALjQL)jJ0"><value name="led"><shadow type="number" id="kp29y|y^sdNz1w-odI)D"><field name="op">2</field></shadow></value><value name="bright"><shadow type="ledswitch" id="v@J_:@rnlXZ*I7ssM7_g"><field name="flag">0</field></shadow></value><next><block type="controls_delay_new" id="/}}Rkuf-C~(^8^C2oF=@"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="u*,(t0Nl~dS{UJD7*O#}"><field name="NUM">0.5</field></shadow></value><next><block type="controls_if" id="bJx)n`6i6-B)uF6NQC1t"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="AJ@/vI+v$GS*3!Hk@)5p"><value name="btn"><shadow type="pins_button" id="/,m6z}4qx1auZza[v1uP"><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO0"><block type="actuator_onboard_neopixel_rgb_all" id="`]6_w,2_k^uvU0z_f(l."><value name="RVALUE"><shadow type="math_number" id="t_|/q$Pm=)QzFqM(zdL@"><field name="NUM">10</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="-EPO`A5Uf0D?vyMSK7q_"><field name="NUM">10</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="ttA}}Sm*}w]G}sm$2J/6"><field name="NUM">10</field></shadow></value><next><block type="actuator_onboard_neopixel_write" id="qB#2E0ct$RPA:4D:gK=h"></block></next></block></statement><next><block type="controls_if" id="!.6J@^P~KLzmmt[`n,?N"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="bD@npo!,97kgrY53]oz)"><value name="btn"><shadow type="pins_button" id="GqFqK4)k-#uz5}$7(::B"><field name="PIN">B2key</field></shadow></value></block></value><statement name="DO0"><block type="actuator_onboard_neopixel_rgb_all" id="(RZ4;#GP:~V5FOK=pmDL"><value name="RVALUE"><shadow type="math_number" id="wCBo.j^FX$lF$:?X0j5v"><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id=".|#q?h_M8=g/L!11qde1"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="B=0cb_]b_TL^V}4i]-U{"><field name="NUM">0</field></shadow></value><next><block type="actuator_onboard_neopixel_write" id="Rkw{hUa]9gRx.sV0K{C$"></block></next></block></statement></block></next></block></next></block></next></block></next></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBvbmJvYXJkX2xlZAppbXBvcnQgdGltZQppbXBvcnQgbWl4Z29fbm92YQpmcm9tIG1peGdvX25vdmEgaW1wb3J0IG9uYm9hcmRfcmdiCgoKd2hpbGUgVHJ1ZToKICAgIG9uYm9hcmRfbGVkLnNldG9ub2ZmKDIsMSkKICAgIHRpbWUuc2xlZXAoMC41KQogICAgb25ib2FyZF9sZWQuc2V0b25vZmYoMiwwKQogICAgdGltZS5zbGVlcCgwLjUpCiAgICBpZiBtaXhnb19ub3ZhLkIxa2V5Lndhc19wcmVzc2VkKCk6CiAgICAgICAgb25ib2FyZF9yZ2IuZmlsbCgoMTAsIDEwLCAxMCkpCiAgICAgICAgb25ib2FyZF9yZ2Iud3JpdGUoKQogICAgaWYgbWl4Z29fbm92YS5CMmtleS53YXNfcHJlc3NlZCgpOgogICAgICAgIG9uYm9hcmRfcmdiLmZpbGwoKDAsIDAsIDApKQogICAgICAgIG9uYm9hcmRfcmdiLndyaXRlKCkK</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><variables><variable id="kujED6C|3`}2*o!`dvF;">x</variable></variables><block type="sensor_mixgo_button_attachInterrupt" id="+CV1?edF3pv?DB*E^a2Z" x="-2776" y="-1011"><field name="mode">machine.Pin.IRQ_RISING</field><value name="btn"><shadow type="pins_button" id="rkR*P5+J.^fQU~fD~-ty"><field name="PIN">B1key</field></shadow></value><value name="DO"><shadow type="factory_block_return" id="b1/{a}~d{+Vk.6?cqQML"><field name="VALUE">attachInterrupt_func</field></shadow></value><next><block type="sensor_mixgo_button_attachInterrupt" id="YbL**jA~.CvDd(pc/N?X"><field name="mode">machine.Pin.IRQ_RISING</field><value name="btn"><shadow type="pins_button" id="8bbO=F?gSc_GDjUdEU[Y"><field name="PIN">B2key</field></shadow></value><value name="DO"><shadow type="factory_block_return" id="izP0[~AE.-nWP:1lM9+b"><field name="VALUE">attachInterrupt_func2</field></shadow></value><next><block type="controls_whileUntil" id="LO9xp~#gD6MDWv(F*QTB"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id=",Re,:HTBzVi!pEW6pC{/"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="actuator_led_bright" id="so6V6~r:bJcMF9G}D.fm"><value name="led"><shadow type="number" id="5tIj~`j/ZUiiYf7|m-rI"><field name="op">2</field></shadow></value><value name="bright"><shadow type="ledswitch" id="d09C54u?{4*fZh6l`K7q"><field name="flag">1</field></shadow></value><next><block type="controls_delay_new" id="[gWngqx1hQJ@jhy$fWEc"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="8L^ojVc)aB.oU[`utIA5"><field name="NUM">0.5</field></shadow></value><next><block type="actuator_led_bright" id="AZapJnkZVPjGFpqsYu/y"><value name="led"><shadow type="number" id="s1)h,[1Hw4S_mcEi7mH8"><field name="op">2</field></shadow></value><value name="bright"><shadow type="ledswitch" id="WsVbm)wHQ8#L+(i!T?F}"><field name="flag">0</field></shadow></value><next><block type="controls_delay_new" id="t/]?TAIVTS=UigGu1^.N"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="KE:)jUp)Nv~GtI-/V2rd"><field name="NUM">0.5</field></shadow></value></block></next></block></next></block></next></block></statement></block></next></block></next></block><block type="procedures_defnoreturn" id="NfJ|E$mQ6ZB~!Sh|)TMm" x="-2951" y="-653"><mutation><arg name="x" varid="kujED6C|3`}2*o!`dvF;"></arg></mutation><field name="NAME">attachInterrupt_func</field><statement name="STACK"><block type="actuator_onboard_neopixel_rgb_all" id="Wqd`,cmQ12bUFdE3MV0i"><value name="RVALUE"><shadow type="math_number" id="hEH@fUF68toQf@8?avM3"><field name="NUM">10</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="u;l+=qaI9(6nFoUod;#b"><field name="NUM">10</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="X{4KZe]esR(W^TO@#g@H"><field name="NUM">10</field></shadow></value><next><block type="actuator_onboard_neopixel_write" id="`IDvUcG#]3v^7*.DE?M."></block></next></block></statement></block><block type="procedures_defnoreturn" id="]*[s*ibc,r]Dm,jl:NIW" x="-2535" y="-652"><mutation><arg name="x" varid="kujED6C|3`}2*o!`dvF;"></arg></mutation><field name="NAME">attachInterrupt_func2</field><statement name="STACK"><block type="actuator_onboard_neopixel_rgb_all" id="dIkYE]G=nCH+ml.eA!V,"><value name="RVALUE"><shadow type="math_number" id="I/R8DK8e|;Kl+pJH^g_+"><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="hZoKE@vOjfxoPHmie^X/"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="~oYJ5w:TdYR`:KSFC~d/"><field name="NUM">0</field></shadow></value><next><block type="actuator_onboard_neopixel_write" id="o`*o_!!up+5n4-KjcChA"></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1hY2hpbmUKaW1wb3J0IG1peGdvX25vdmEKZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBvbmJvYXJkX2xlZAppbXBvcnQgdGltZQpmcm9tIG1peGdvX25vdmEgaW1wb3J0IG9uYm9hcmRfcmdiCgoKZGVmIGF0dGFjaEludGVycnVwdF9mdW5jKHgpOgogICAgb25ib2FyZF9yZ2IuZmlsbCgoMTAsIDEwLCAxMCkpCiAgICBvbmJvYXJkX3JnYi53cml0ZSgpCgpkZWYgYXR0YWNoSW50ZXJydXB0X2Z1bmMyKHgpOgogICAgb25ib2FyZF9yZ2IuZmlsbCgoMCwgMCwgMCkpCiAgICBvbmJvYXJkX3JnYi53cml0ZSgpCgoKCm1peGdvX25vdmEuQjFrZXkuaXJxKGhhbmRsZXI9YXR0YWNoSW50ZXJydXB0X2Z1bmMsIHRyaWdnZXI9bWFjaGluZS5QaW4uSVJRX1JJU0lORykKbWl4Z29fbm92YS5CMmtleS5pcnEoaGFuZGxlcj1hdHRhY2hJbnRlcnJ1cHRfZnVuYzIsIHRyaWdnZXI9bWFjaGluZS5QaW4uSVJRX1JJU0lORykKd2hpbGUgVHJ1ZToKICAgIG9uYm9hcmRfbGVkLnNldG9ub2ZmKDIsMSkKICAgIHRpbWUuc2xlZXAoMC41KQogICAgb25ib2FyZF9sZWQuc2V0b25vZmYoMiwwKQogICAgdGltZS5zbGVlcCgwLjUpCg==</code>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><variables><variable id="ok:ro0iEW(eJAtg/iAsj">tim</variable></variables><block type="variables_set" id="puN{SUBH:Tyi[2ZvBqR7" x="-2908" y="-1031"><field name="VAR">开始</field><value name="VALUE"><block type="logic_boolean" id="pUp|ZJ4qzVezAv_lCa$,"><field name="BOOL">FALSE</field></block></value><next><block type="variables_set" id="vp5|htyz1MsQ.98W_vi9"><field name="VAR">计时</field><value name="VALUE"><block type="math_number" id="LH`DIDTn-(h?0/lvt]ON"><field name="NUM">0</field></block></value><next><block type="system_timer_init" id="A_tSp=mI:q2_R!kqPB5E"><value name="SUB"><shadow type="variables_get" id=",n*xk.jB,j_F0Gupzfc+"><field name="VAR">tim</field></shadow></value><next><block type="system_timer" id="-yUQ]Jbg9P;tQ#1Ca;F?"><field name="mode">PERIODIC</field><value name="VAR"><shadow type="variables_get" id="w90U7lnK4(*rA#SBW3mG"><field name="VAR">tim</field></shadow></value><value name="period"><shadow type="math_number" id="Ld?F1Ca7r6L;wD0Kj+j5"><field name="NUM">100</field></shadow></value><value name="callback"><shadow type="factory_block_return" id="/1ImPw-p[Tr2X}-W`Z^o"><field name="VALUE">tim_callback</field></shadow></value><next><block type="controls_whileUntil" id="=q+_pIc.Fz[8X4ERCx~}"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="Xb(d.2zIs.c#?z*0BkTt"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="QR$1#ni$^.I$f^b:g-47"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="q#G)x?*Go)d}!,haW8O9"><value name="btn"><shadow type="pins_button" id="fY(GtXnw#LB;TDlD5mm0"><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO0"><block type="variables_set" id="Q:Miirya_N.Msa)#U{=n"><field name="VAR">开始</field><value name="VALUE"><block type="logic_negate" id="-{#;|P?}?9YEb1OY_I.n"><value name="BOOL"><block type="variables_get" id="nV.F@Z}E}s1/EcQg4F*K"><field name="VAR">开始</field></block></value></block></value></block></statement></block></statement></block></next></block></next></block></next></block></next></block><block type="procedures_defnoreturn" id="[jvrfZ9ylw?SAnL4Sz^A" x="-2911" y="-737"><mutation><arg name="tim" varid="ok:ro0iEW(eJAtg/iAsj"></arg></mutation><field name="NAME">tim_callback</field><statement name="STACK"><block type="variables_global" id="okC,dnYx2O((h:ZI)*p?"><value name="VAR"><block type="variables_get" id="EdFWnI7yU;l1w(IV^Pz;"><field name="VAR">计时</field></block></value><next><block type="variables_global" id="@tOJs6d2oK;7gUQ@+.fm"><value name="VAR"><block type="variables_get" id="DEpP0@Lamyyy1aLUdnFl"><field name="VAR">开始</field></block></value><next><block type="controls_if" id="3]ohr;s_lfLkWaLoCUUS"><value name="IF0"><block type="variables_get" id="[uc8ey/Kmz=P)!CUc]z+"><field name="VAR">开始</field></block></value><statement name="DO0"><block type="math_selfcalcu" id="7X}5oHcSK}ql{)X3:]66"><field name="OP">ADD</field><value name="A"><shadow type="variables_get" id="f0ZOr]=f^WJQR{)=D4On"><field name="VAR">a</field></shadow><block type="variables_get" id="$o48-,wu+E0$B(r;.)40"><field name="VAR">计时</field></block></value><value name="B"><shadow type="math_number" id="N9-j0hY+4/jT~ENz!XF|"><field name="NUM">1</field></shadow></value><next><block type="display_show_image_or_string_delay" id="Z*-F_jl{6JRsJdnN-v7b"><field name="center">True</field><value name="data"><shadow type="text" id="AMg9Be-;,dEM[CgS0N)h"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="!iWk1I65d1q9K?UZ8dIQ"><value name="VAR"><shadow type="variables_get" id=":rP;gw1-A?*m6;txmk7!"><field name="VAR">x</field></shadow><block type="variables_get" id="pM+]{U0@e.hT)(TQP+So"><field name="VAR">计时</field></block></value></block></value><value name="space"><shadow type="math_number" id="$]L=jo*s=xX.fclb44TX"><field name="NUM">0</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="Ev1!+#0(D)g9J@ZykSiE"><field name="BOOL">TRUE</field></shadow></value></block></next></block></statement></block></next></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1hY2hpbmUKaW1wb3J0IG1peGdvX25vdmEKZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBvbmJvYXJkX3RmdAoKZGVmIHRpbV9jYWxsYmFjayh0aW0pOgogICAgZ2xvYmFsIOiuoeaXtgogICAgZ2xvYmFsIOW8gOWniwogICAgaWYg5byA5aeLOgogICAgICAgIOiuoeaXtiArPSAxCiAgICAgICAgb25ib2FyZF90ZnQuc2hvd3Moc3RyKOiuoeaXtiksIHNwYWNlPTAsIGNlbnRlcj1UcnVlLHN5bmM9VHJ1ZSkKCgrlvIDlp4sgPSBGYWxzZQrorqHml7YgPSAwCnRpbSA9IG1hY2hpbmUuVGltZXIoMCkKdGltLmluaXQocGVyaW9kID0gMTAwLCBtb2RlPW1hY2hpbmUuVGltZXIuUEVSSU9ESUMsIGNhbGxiYWNrPXRpbV9jYWxsYmFjaykKd2hpbGUgVHJ1ZToKICAgIGlmIG1peGdvX25vdmEuQjFrZXkud2FzX3ByZXNzZWQoKToKICAgICAgICDlvIDlp4sgPSBub3Qg5byA5aeLCg==</code>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="controls_whileUntil" id="Na5i:+^/f!7RjD?7T|dN" x="-3074" y="-1055"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="je:4Ai`5_ea;)^?m]6fq"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="actuator_led_bright" id="pFoR?K3E{P*GxEVXFp}o"><value name="led"><shadow type="number" id="YeD-C@;(B,m-m!i#)mgk"><field name="op">2</field></shadow></value><value name="bright"><shadow type="ledswitch" id="rn^Ql*gy@V;W#W;~Rdh8"><field name="flag">1</field></shadow></value><next><block type="controls_delay_new" id="q]f`K6_dA?qTm3y!MM(3"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id=";DbXOJV*a{F46wKuG)[@"><field name="NUM">0.5</field></shadow></value><next><block type="actuator_led_bright" id="lQD(ThEp4|7z]pPek_Hd"><value name="led"><shadow type="number" id="P(D1,MG,L~T.|MK9r7au"><field name="op">2</field></shadow></value><value name="bright"><shadow type="ledswitch" id="g](v6VK;Vxx~hcj^dIx/"><field name="flag">0</field></shadow></value><next><block type="controls_delay_new" id="l[02qeRLK#W}F.3[J$.."><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="}]_8xBi2)]d^N=hIsT-E"><field name="NUM">0.5</field></shadow></value><next><block type="variables_set" id=".9i_lC/dX_-Y8TLa$T3+"><field name="VAR">错误变量</field><value name="VALUE"><block type="logic_negate" id="G|90T^r-rXq,DiTw]O2!"><value name="BOOL"><block type="variables_get" id="r5u1zfy=6vbi]wLoCrJT"><field name="VAR">错误变量</field></block></value></block></value></block></next></block></next></block></next></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBvbmJvYXJkX2xlZAppbXBvcnQgdGltZQoKCndoaWxlIFRydWU6CiAgICBvbmJvYXJkX2xlZC5zZXRvbm9mZigyLDEpCiAgICB0aW1lLnNsZWVwKDAuNSkKICAgIG9uYm9hcmRfbGVkLnNldG9ub2ZmKDIsMCkKICAgIHRpbWUuc2xlZXAoMC41KQogICAg6ZSZ6K+v5Y+Y6YePID0gbm90IOmUmeivr+WPmOmHjwo=</code>F85OV9FOF9BRl9BRl9FNV84Rl85OF9FOV84N184Rgo=</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-S3@元控青春NOVA"><block type="controls_whileUntil" id=".2MP?p:vJ8?hu6zpjpXq" x="-3074" y="-1055"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="EOxOkUQi2MVsIlJI8=/t"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="actuator_led_bright" id="Va26GZBsN`Nir3Vzl7bi"><value name="led"><shadow type="number" id="eaF|)7[|v_uw+*GH_O_y"><field name="op">2</field></shadow></value><value name="bright"><shadow type="ledswitch" id="8ll23jmC(73X8Eu7RZ$7"><field name="flag">1</field></shadow></value><next><block type="controls_delay_new" id="0DYssL9)eJI*7^P/py2e"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id=",vF;-6*J:31{~g(/G8Fe"><field name="NUM">0.5</field></shadow></value><next><block type="actuator_led_bright" id="6^(3dD`GrdJ(/{O,(qT4"><value name="led"><shadow type="number" id="xgT+Hp3^06xjH*T-@d(V"><field name="op">2</field></shadow></value><value name="bright"><shadow type="ledswitch" id="~Ci:r1tPPLl5TVt#QKLG"><field name="flag">0</field></shadow></value><next><block type="controls_delay_new" id="(Gxr.nu}$9,LFltccf.I"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="wYp{,rev9x}3McU3yl~7"><field name="NUM">0.5</field></shadow></value><next><block type="controls_try_finally" id="c^;--L#^Ohb.k_8p*1rD"><mutation elseif="1"></mutation><statement name="try"><block type="variables_set" id="H9xrM~9vzD/R7xFyn?LR"><field name="VAR">错误变量</field><value name="VALUE"><block type="logic_negate" id="Z;p#=PpG?[S=C0rZ/^Tz"><value name="BOOL"><block type="variables_get" id=".pHd/MkLYD2MV(7skb!!"><field name="VAR">错误变量</field></block></value></block></value></block></statement><value name="IF1"><shadow type="factory_block_return" id="|]4!j#YlEt`mUS]lM_rX"><field name="VALUE">Exception as e</field></shadow></value><statement name="DO1"><block type="system_print" id="]_$x/M;,O5M:~xRoaU(7" disabled="true"><value name="VAR"><block type="variables_get" id="fH+Fzoo3A]iQ.R*mZ@ic"><field name="VAR">e</field></block></value></block></statement></block></next></block></next></block></next></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBvbmJvYXJkX2xlZAppbXBvcnQgdGltZQoKCndoaWxlIFRydWU6CiAgICBvbmJvYXJkX2xlZC5zZXRvbm9mZigyLDEpCiAgICB0aW1lLnNsZWVwKDAuNSkKICAgIG9uYm9hcmRfbGVkLnNldG9ub2ZmKDIsMCkKICAgIHRpbWUuc2xlZXAoMC41KQogICAgdHJ5OgogICAgICAgIF9FOV85NF85OV9FOF9BRl9BRl9FNV84Rl85OF9FOV84N184RiA9IG5vdCBfRTlfOTRfOTlfRThfQUZfQUZfRTVfOEZfOThfRTlfODdfOEYKICAgIGV4Y2VwdCBFeGNlcHRpb24gYXMgZToKICAgICAgICBwYXNzCg==</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-S3@元控青春NOVA"><block type="controls_whileUntil" id="?@vOeeg`@o5~EpW;fJvP" x="-3394" y="-997"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="x5z448AvI!)f6tooS{aB"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="system_print" id="f+8V47-TfN`1(+ou$M2v"><value name="VAR"><shadow type="text" id="Rt+E)0-J_k0/2|bCGoE1"><field name="TEXT">Mixly</field></shadow><block type="rfid_readid" id="D1sR9f:qTkQK2Cy(=LI5"></block></value><next><block type="controls_delay_new" id="#q2Kl5hNFgnZSNLr=e}4"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="O-LG)`nE~@uR?;Ri:Az["><field name="NUM">1</field></shadow></value></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1hY2hpbmUKZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBvbmJvYXJkX3JmaWQKaW1wb3J0IHRpbWUKCgp3aGlsZSBUcnVlOgogICAgcHJpbnQob25ib2FyZF9yZmlkLnJlYWRfY2FyZCgwLCB4PSJpZCIpKQogICAgdGltZS5zbGVlcCgxKQo=</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="variables_set" id="fL9w,ma~n0ZgxsK!L8r_" x="-3403" y="-1132"><field name="VAR">id</field><value name="VALUE"><block type="math_number" id="!I#l~hte-$-pfYBgv93T"><field name="NUM">0</field></block></value><next><block type="controls_whileUntil" id="{|/C/zFaJxbZY@kS+}_g"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="7!ijIXlf#4[4e*Y3mfZz"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="variables_set" id="]ryS-4uH75IP[M5-rQQ;"><field name="VAR">id</field><value name="VALUE"><block type="rfid_readid" id="?L9Mq}YYCqu9o6r5s^#Y"></block></value><next><block type="controls_if" id="3kCZ#Xz,Y1W^zVe7axq?"><value name="IF0"><block type="logic_compare" id="8L:L_?Ags~spbaEWVz-a"><field name="OP">NEQ</field><value name="A"><block type="number_to_text" id="Pf+tdv0pjP0MOyl;kVyy"><value name="VAR"><shadow type="variables_get" id="bu+Vwq2(^!T:Ga|?^^JF"><field name="VAR">x</field></shadow><block type="variables_get" id="dIX@8v27,IBdiflm3}#M"><field name="VAR">id</field></block></value></block></value><value name="B"><block type="text" id="?HrZb5y`[yHptc7pmT3N"><field name="TEXT">None</field></block></value></block></value><statement name="DO0"><block type="esp32_onboard_music_pitch_with_time" id="xZL~B+Rm9yTrYS_@FF2!"><value name="pitch"><shadow type="pins_tone_notes" id="},ChiDz5`7A$^=b_U7d~"><field name="PIN">659</field></shadow></value><value name="time"><shadow type="math_number" id="[Fb.zN1N=568uwlha}QJ"><field name="NUM">50</field></shadow></value><next><block type="system_print" id="e/D.V]$?cLh./SJJjl_z"><value name="VAR"><shadow type="text" id="hwGk6onT~T-70eFH2}3{"><field name="TEXT">Mixly</field></shadow><block type="variables_get" id="-)LlUVp9)OuKP!LZdVKY"><field name="VAR">id</field></block></value><next><block type="onboard_tft_show_image_or_string_delay" id="(sdD{jxdH5fqvZrMu)_q"><field name="center">True</field><value name="data"><shadow type="text" id="3l4{w9l5b5q*Qi.cph!1"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="u$O`|!d=Og]}{d[ICjAd"><value name="VAR"><shadow type="variables_get" id="Tah(MJTP{:tR+Lwkw?[V"><field name="VAR">x</field></shadow><block type="variables_get" id="yPH`2$V=p[,egP5nKg9Z"><field name="VAR">id</field></block></value></block></value><value name="x"><shadow type="math_number" id="ab3}ama}Lr(?,dY6$c]5"><field name="NUM">0</field></shadow></value><value name="y"><shadow type="math_number" id="bU2-B7x!VPjt{n5iKna."><field name="NUM">64</field></shadow></value><value name="size"><shadow type="math_number" id="~#81Ev/C!tu;+_M=[d5!"><field name="NUM">1</field></shadow></value><value name="space"><shadow type="math_number" id="{#J}8G:)Lhv3X,=x/HQ]"><field name="NUM">0</field></shadow></value><value name="VAR"><shadow type="tuple_create_with_text_return" id="M3Zjq?Kzqw?D]PZj5DZ_"><field name="TEXT">255,255,0</field></shadow><block type="display_color_seclet" id="O,i-Z.6O73`hGq+u_82G"><field name="COLOR">#ffffff</field></block></value><value name="boolean"><shadow type="logic_boolean" id="xh+p}i|E~O[m1P-=maU^"><field name="BOOL">TRUE</field></shadow></value></block></next></block></next></block></statement></block></next></block></statement></block></next></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19ub3ZhIGltcG9ydCBvbmJvYXJkX3JmaWQKZnJvbSBtaXhnb19ub3ZhX3ZvaWNlIGltcG9ydCBzcGtfbWlkaQppbXBvcnQgbWFjaGluZQpmcm9tIG1peGdvX25vdmEgaW1wb3J0IG9uYm9hcmRfdGZ0CgppZDIgPSAwCndoaWxlIFRydWU6CiAgICBpZDIgPSBvbmJvYXJkX3JmaWQucmVhZF9jYXJkKDAsIHg9ImlkIikKICAgIGlmIHN0cihpZDIpICE9ICdOb25lJzoKICAgICAgICBzcGtfbWlkaS5waXRjaF90aW1lKDY1OSwgNTApCiAgICAgICAgcHJpbnQoaWQyKQogICAgICAgIG9uYm9hcmRfdGZ0LnNob3dzKHN0cihpZDIpLCB4PTAsIHk9NjQsIHNpemU9MSwgc3BhY2U9MCwgY2VudGVyPVRydWUsIGNvbG9yPTB4ZmZmZixzeW5jPVRydWUpCg==</code>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="espnow_radio_channel" id="6Xh)sD(#a`}uiI35Au-j" x="-912" y="-519"><value name="CHNL"><shadow type="espnow_channel" id="qClJ^]L{P9.~-Z9M?2hL"><field name="PIN">10</field></shadow></value><next><block type="espnow_radio_on_off" id="KEo@Enn_`CD.XSfA8RwW"><field name="on_off">True</field><next><block type="controls_whileUntil" id="jmlER`NJiE5EyV0sP-/~"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="B|kZ~O[_yMNL4h8|iy/6"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="bX9gt3kM$)lgWH${gW(9"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="Xd(=AU.iZK9sY6BIrdKa"><value name="btn"><shadow type="pins_button" id="!z($sxM{xo.!{_eBDV7o"><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO0"><block type="espnow_radio_send" id="XKiK{p{5W[ku3TUpb|vi"><value name="send"><shadow type="text" id=",}IF,SDrd7+r_chC+kHF"><field name="TEXT">LEFT</field></shadow></value></block></statement><next><block type="controls_if" id="+)2wpR3_og7nCEVf-(F|"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id=")s:-hsMk|?P[,djjVm:X"><value name="btn"><shadow type="pins_button" id="I$b`A$Y~R)Ud*!N24!A9"><field name="PIN">B2key</field></shadow></value></block></value><statement name="DO0"><block type="espnow_radio_send" id="cy$mJayoo*Uz8#ZvU34V"><value name="send"><shadow type="text" id="b|{|M|taWJR5DMZsU2f/"><field name="TEXT">RIGHT</field></shadow></value></block></statement></block></next></block></statement></block></next></block></next></block><block type="espnow_radio_recv_new" id="]ji9i;=jKKyhO82lD]1n" x="-894" y="-189"><statement name="DO"><block type="system_print" id="n2)pIYOCosg]m4RlWnsj"><value name="VAR"><block type="espnow_radio_recv_msg" id="EdCX)uU~-HS6;2DqTN]R"></block></value></block></statement></block><block type="espnow_radio_recv_certain_msg_new" id="iCrgEMx9Sda!no7Sg6Rv" x="-892" y="-108"><field name="msg">LEFT</field><statement name="DO"><block type="display_show_image_or_string_delay" id="~,K$/Q5$cpRks,H}K4:|"><field name="center">True</field><value name="data"><shadow type="text" id="HP_{49a)i`*6z2o=+_#u"><field name="TEXT">LEFT</field></shadow></value><value name="space"><shadow type="math_number" id=")lG#o.1X[?~`S91(6evX"><field name="NUM">0</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="xh+p}i|E~O[m1P-=maU^"><field name="BOOL">TRUE</field></shadow></value></block></statement></block><block type="espnow_radio_recv_certain_msg_new" id="Mk`tt.lakYitusB@{RGm" x="-893" y="-14"><field name="msg">RIGHT</field><statement name="DO"><block type="display_show_image_or_string_delay" id="|)0a8E/Mp3--yjEs8IlB"><field name="center">True</field><value name="data"><shadow type="text" id="=wr7hu434]Vdzn1|xSgO"><field name="TEXT">RIGHT</field></shadow></value><value name="space"><shadow type="math_number" id="30!umn{YSVsd.Y{blDh{"><field name="NUM">0</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="VV^$xV/Ju(v$-[i/I!SC"><field name="BOOL">TRUE</field></shadow></value></block></statement></block></xml><config>{}</config><code>aW1wb3J0IHJhZGlvCmltcG9ydCBtaXhnb19ub3ZhCmltcG9ydCBtYWNoaW5lCmZyb20gbWl4Z29fbm92YSBpbXBvcnQgb25ib2FyZF90ZnQKCkVTUE5vd19yYWRpbyA9IHJhZGlvLkVTUE5vdygpCgpkZWYgRVNQTm93X3JhZGlvX3JlY3YobWFjLCBFU1BOb3dfcmFkaW9fbXNnKToKICAgIHByaW50KEVTUE5vd19yYWRpb19tc2cpCgpFU1BOb3dfcmFkaW8ucmVjdl9jYigiX19hbGxfXyIsIEVTUE5vd19yYWRpb19yZWN2KQoKZGVmIEVTUE5vd19yYWRpb19yZWN2KG1hYywgRVNQTm93X3JhZGlvX21zZyk6CiAgICBvbmJvYXJkX3RmdC5zaG93cygnTEVGVCcsIHNwYWNlPTAsIGNlbnRlcj1UcnVlLHN5bmM9VHJ1ZSkKCkVTUE5vd19yYWRpby5yZWN2X2NiKCJMRUZUIiwgRVNQTm93X3JhZGlvX3JlY3YpCgpkZWYgRVNQTm93X3JhZGlvX3JlY3YobWFjLCBFU1BOb3dfcmFkaW9fbXNnKToKICAgIG9uYm9hcmRfdGZ0LnNob3dzKCdSSUdIVCcsIHNwYWNlPTAsIGNlbnRlcj1UcnVlLHN5bmM9VHJ1ZSkKCkVTUE5vd19yYWRpby5yZWN2X2NiKCJSSUdIVCIsIEVTUE5vd19yYWRpb19yZWN2KQoKCkVTUE5vd19yYWRpby5zZXRfY2hhbm5lbChjaGFubmVsPTEwKQpFU1BOb3dfcmFkaW8uYWN0aXZlKFRydWUpCndoaWxlIFRydWU6CiAgICBpZiBtaXhnb19ub3ZhLkIxa2V5Lndhc19wcmVzc2VkKCk6CiAgICAgICAgRVNQTm93X3JhZGlvLnNlbmQoImZmZmZmZmZmZmZmZiIsJ0xFRlQnKQogICAgaWYgbWl4Z29fbm92YS5CMmtleS53YXNfcHJlc3NlZCgpOgogICAgICAgIEVTUE5vd19yYWRpby5zZW5kKCJmZmZmZmZmZmZmZmYiLCdSSUdIVCcpCg==</code>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><variables><variable id="F6AZf]?TTBrVz3!HK,|p">cmd</variable><variable id="9evLpxY)q7CIC6uw4yKm">addr</variable><variable id="=T.Z=tj(7{K$1-8-Jmp|">raw</variable><variable id="bY/n=T#mN)b(Cy}6c4qY">pulses</variable></variables><block type="communicate_ir_recv_init" id="8vmg4xjcryKG)V[LSVz{" x="0" y="0"><field name="type">0</field><value name="PIN"><shadow type="pins_digital_pin" id="wK=tg[Abjg5]-H`2Vz?C"><field name="PIN">16</field></shadow></value><value name="SUB"><shadow type="factory_block_return" id="_MI,sw=m;=KrT=6q9gi!"><field name="VALUE">callback</field></shadow></value><next><block type="communicate_ir_send_init" id="pbJ#act*N,)WuB5?sNV{"><field name="type">False</field><value name="PIN"><shadow type="pins_digital_pin" id="fqmXAP;:(5tWSZpXV2)s"><field name="PIN">21</field></shadow></value><value name="power"><shadow type="math_number" id="#SUE9q`DhiECl6KBz]Ue"><field name="NUM">100</field></shadow></value><next><block type="controls_whileUntil" id="kklNs[m(S-*VW/L?|`PK"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="cLIMW9[#D-.qaLEzDT]9"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="c2tOXoxd8Mi$,,Xu!A`Z"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="^CibU@E1dRyC?ONYW!#I"><value name="btn"><shadow type="pins_button" id="F:mHpd-/gT(c)K^~7(@9"><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO0"><block type="ir_transmit_raw_code" id="${TA[nLjCvqQB!ec@bX7"><value name="raw"><shadow type="math_number" id="kLTVzIT_a2#V~Uu[jRF)"><field name="NUM">0x1234</field></shadow></value></block></statement><next><block type="controls_if" id="n27uq?*tz2{WW5$5p/FA"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="hIprAxVk(DpMEXJvHhPx"><value name="btn"><shadow type="pins_button" id=")A)gH{nG6-o06pVaT8zz"><field name="PIN">B2key</field></shadow></value></block></value><statement name="DO0"><block type="ir_transmit_raw_code" id="d1Lh]S#WS?35~5$4gi)M"><value name="raw"><shadow type="math_number" id="^rHeE_,h5x3+_M1+E}tf"><field name="NUM">0xABCD</field></shadow></value></block></statement></block></next></block></statement></block></next></block></next></block><block type="procedures_defnoreturn" id="`v^7k5YI6BvbN3ab^fY#" x="0" y="336"><mutation><arg name="cmd" varid="F6AZf]?TTBrVz3!HK,|p"></arg><arg name="addr" varid="9evLpxY)q7CIC6uw4yKm"></arg><arg name="raw" varid="=T.Z=tj(7{K$1-8-Jmp|"></arg><arg name="pulses" varid="bY/n=T#mN)b(Cy}6c4qY"></arg></mutation><field name="NAME">callback</field><statement name="STACK"><block type="system_print_many" id="x`H85L;.O{ig)/GGaS)C"><mutation items="4"></mutation><value name="ADD0"><block type="variables_get" id="AUwX=77W-Mlrn}Yg_=@N"><field name="VAR">cmd</field></block></value><value name="ADD1"><block type="variables_get" id="?qS~3vJ3k2:s9icq?pKn"><field name="VAR">addr</field></block></value><value name="ADD2"><block type="math_number_base_conversion" id="{Dt{J0O.Q4q8^p1$W0yQ"><field name="OP">ten</field><field name="OP2">sixteen</field><value name="NUM"><shadow type="math_number" id="xP,-,yP-`MysG3[dgT8T"><field name="NUM">1010</field></shadow><block type="variables_get" id="C.QBQgZMdO`HZh1x2#.m"><field name="VAR">raw</field></block></value></block></value><value name="ADD3"><block type="variables_get" id=",fr+}3hY#vN2L)LPjrol"><field name="VAR">pulses</field></block></value></block></statement></block></xml><config>{}</config><code>aW1wb3J0IGlycmVtb3RlCmltcG9ydCBtaXhnb19ub3ZhCmltcG9ydCBtYXRoCgpkZWYgY2FsbGJhY2soY21kLCBhZGRyLCByYXcsIHB1bHNlcyk6CiAgICBwcmludChjbWQsIGFkZHIsIGhleChpbnQoc3RyKHJhdyksIDEwKSksIHB1bHNlcykKCgppcl9yeCA9IGlycmVtb3RlLk5FQ19SWCgxNiwgMCwgY2FsbGJhY2spCmlyX3R4ID0gaXJyZW1vdGUuTkVDX1RYKDIxLCBGYWxzZSwgMTAwKQp3aGlsZSBUcnVlOgogICAgaWYgbWl4Z29fbm92YS5CMWtleS53YXNfcHJlc3NlZCgpOgogICAgICAgIGlyX3R4LnRyYW5zbWl0KHJhdz0weDEyMzQpCiAgICBpZiBtaXhnb19ub3ZhLkIya2V5Lndhc19wcmVzc2VkKCk6CiAgICAgICAgaXJfdHgudHJhbnNtaXQocmF3PTB4QUJDRCkK</code>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-S3@元控青春NOVA"><block type="communicate_ir_recv_init" id="u}8nFi`_g^C1U[RD:r(S" x="-961" y="-259"><field name="type">0</field><value name="PIN"><shadow type="pins_digital_pin" id="WCAi$bu!*uf;[_FvU/go"><field name="PIN">16</field></shadow></value><value name="SUB"><shadow type="factory_block_return" id="TJgS(#t_]w1H#J[ZABmC"><field name="VALUE"></field></shadow></value><next><block type="variables_set" id="7(7X1+ruuGtSip;hKR5|"><field name="VAR">万能遥控码1</field><value name="VALUE"><block type="list_many_input" id="~];{5dA(IVM~KWskYW^3"><field name="CONTENT">9400,4500,560,560</field></block></value><next><block type="controls_whileUntil" id="2bBF2vLd)5]UY1TL2@YM"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="`Tx#Iw-dS|!uHa72$}V0"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="5`hG6Zi;i6LRY{BT,xd["><value name="IF0"><block type="ir_whether_recv" id="{^QS-8vTrcaXQcou)xTU"></block></value><statement name="DO0"><block type="variables_set" id="_d2=qG^OLeB}`7wxg+Fp"><field name="VAR">万能遥控码1</field><value name="VALUE"><block type="internal_variable" id="H=Sx7}Ry7ZrtIplTP@=Q"><field name="index">3</field></block></value><next><block type="system_print_many" id=":Heuu~W@RcReRYRdh@0C"><mutation items="3"></mutation><value name="ADD0"><block type="math_dec" id="[s+q;F$7/DMx0gj_+L+j"><field name="OP">hex</field><value name="NUM"><shadow type="math_number" id="fRMYQd9Trq_{o4~gw8sa"><field name="NUM">15</field></shadow><block type="internal_variable" id="VtWM=X_6d.1BZN~]h4m^"><field name="index">2</field></block></value></block></value><value name="ADD1"><block type="list_trig" id="i5JadXbk0QFQXk6/F@i#"><field name="OP">LEN</field><value name="data"><shadow type="variables_get" id="4gS=N9*a$V$}(!.HUJW,"><field name="VAR">mylist</field></shadow><block type="internal_variable" id="]s=0}(~h84].bOs3.L~a"><field name="index">3</field></block></value></block></value><value name="ADD2"><block type="list_tolist" id="J*S#D8z{]K~j!o6lOBjB"><value name="VAR"><shadow type="variables_get" id="PPPJ)OJH7.1$+q8:VLs^"><field name="VAR">x</field></shadow><block type="internal_variable" id="wr#d6{_a[2]`LrZx{@n1"><field name="index">3</field></block></value></block></value></block></next></block></statement></block></statement></block></next></block></next></block></xml><config>{}</config><code>aW1wb3J0IGlycmVtb3RlCmltcG9ydCBtYXRoCgoKaXJfcnggPSBpcnJlbW90ZS5ORUNfUlgoMTYsMCkKX0U0X0I4Xzg3X0U4XzgzX0JEX0U5XzgxX0E1X0U2XzhFX0E3X0U3X0EwXzgxMSA9IFs5NDAwLDQ1MDAsNTYwLDU2MF0Kd2hpbGUgVHJ1ZToKICAgIGlmIGlyX3J4LmFueSgpOgogICAgICAgIF9FNF9COF84N19FOF84M19CRF9FOV84MV9BNV9FNl84RV9BN19FN19BMF84MTEgPSBpcl9yeC5jb2RlWzNdCiAgICAgICAgcHJpbnQoaGV4KGlyX3J4LmNvZGVbMl0pLCBsZW4oaXJfcnguY29kZVszXSksIGxpc3QoaXJfcnguY29kZVszXSkpCg==</code>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="iot_wifi_connect" id="rn$-k7Jv-nvOR[![e-p3" x="-1261" y="-422"><value name="WIFINAME"><shadow type="text" id="cp}1Z=J|jDaGQyFu|i^d"><field name="TEXT">fuhua3</field></shadow></value><value name="PASSWORD"><shadow type="text" id="g8]7l(hz+BH@c{pBz0/m"><field name="TEXT">1234567890</field></shadow></value><next><block type="display_show_image_or_string_delay" id=".az|c!Lk_HE5}POSDy]."><field name="center">True</field><value name="data"><shadow type="text" id="fU}KrWb(N:C}`#q3SRG0"><field name="TEXT">WO</field></shadow></value><value name="space"><shadow type="math_number" id="[?)ZB?;:0bs3Aw*(N:.R"><field name="NUM">0</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="xh+p}i|E~O[m1P-=maU^"><field name="BOOL">TRUE</field></shadow></value><next><block type="IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE" id="nc$[#zb7SITW}h](D0Q3"><value name="SERVER"><shadow type="text" id="e}5u5B_Gw#j-addGNH@+"><field name="TEXT">mixio.mixly.cn</field></shadow></value><value name="KEY"><shadow type="iot_mixly_key" id="9Pj!re8@.mlePOc}}]/N"><field name="VISITOR_ID">768LA26V</field></shadow></value><next><block type="display_show_image_or_string_delay" id="eB|_O5fesu:UC@7Ov`fI"><field name="center">True</field><value name="data"><shadow type="text" id="VgaHUZ+?)1*i`;@hSYNj"><field name="TEXT">MO</field></shadow></value><value name="space"><shadow type="math_number" id="NTA(B|END$u_;@I/MyA+"><field name="NUM">0</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="6J@Bft?V7s)FODZ+xDd1"><field name="BOOL">TRUE</field></shadow></value><next><block type="controls_whileUntil" id=";wq6HTRo.AmZBG6o3G+v"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="9r]KRjG1rGY#;@J3`bm^"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="display_show_image_or_string_delay" id="*Kfn{hh`^kMRf`aMs}4m"><field name="center">True</field><value name="data"><shadow type="text" id="|.(+-CmLv|z*ozU0q`4~"><field name="TEXT">MO</field></shadow><block type="number_to_text" id="8T2kxOCKBFY|F[Z;W,9-"><value name="VAR"><shadow type="variables_get" id=")y,SWegzBRRZh:Y!Ai~#"><field name="VAR">x</field></shadow><block type="sensor_mixgo_nova_LTR308" id="4-~]*J5~OMbjRlG}Am[/"><field name="direction">l</field></block></value></block></value><value name="space"><shadow type="math_number" id="~K{[5[M$E+t*AG6O{}L$"><field name="NUM">0</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="!E+Y#@{e!$[7/SzKgkA1"><field name="BOOL">TRUE</field></shadow></value><next><block type="IOT_MIXIO_PUBLISH" id="x7t-?B#ebUpo}7@l#m[K"><value name="TOPIC"><shadow type="text" id="@Hic0/rpI;#Nx{NshN^c"><field name="TEXT">光照</field></shadow></value><value name="MSG"><shadow type="text" id="|nYm+?}P5-.}E~y=71/k"><field name="TEXT">msg</field></shadow><block type="sensor_mixgo_nova_LTR308" id="radKqq,kRz9e4W:Hd/6X"><field name="direction">l</field></block></value><next><block type="controls_delay_new" id="`pI~y{#2DC_(CqWc;B[y"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="k:dFg5iL*2[S=C~eo,P="><field name="NUM">5</field></shadow></value></block></next></block></next></block></statement></block></next></block></next></block></next></block></next></block></xml><config>{}</config><code>aW1wb3J0IG1peGlvdApmcm9tIG1peGdvX25vdmEgaW1wb3J0IG9uYm9hcmRfdGZ0CmltcG9ydCBtYWNoaW5lCmZyb20gdWJpbmFzY2lpIGltcG9ydCBoZXhsaWZ5CmZyb20gbWl4Z29fbm92YSBpbXBvcnQgb25ib2FyZF9hbHNfbAppbXBvcnQgdGltZQoKbWl4aW90LndsYW5fY29ubmVjdCgnZnVodWEzJywgJzEyMzQ1Njc4OTAnKQpvbmJvYXJkX3RmdC5zaG93cygnV08nLCBzcGFjZT0wLCBjZW50ZXI9VHJ1ZSxzeW5jPVRydWUpCk1RVFRfVVNSX1BSSiA9ICJNaXhJTy83NjhMQTI2Vi9kZWZhdWx0LyIKbXF0dF9jbGllbnQgPSBtaXhpb3QuaW5pdF9NUVRUX2NsaWVudCgnbWl4aW8ubWl4bHkuY24nLCAiTWl4SU9fcHVibGljIiwgIk1peElPX3B1YmxpYyIsIE1RVFRfVVNSX1BSSikKb25ib2FyZF90ZnQuc2hvd3MoJ01PJywgc3BhY2U9MCwgY2VudGVyPVRydWUsc3luYz1UcnVlKQp3aGlsZSBUcnVlOgogICAgb25ib2FyZF90ZnQuc2hvd3Moc3RyKG9uYm9hcmRfYWxzX2wuYWxzX3ZpcygpKSwgc3BhY2U9MCwgY2VudGVyPVRydWUsc3luYz1UcnVlKQogICAgbXF0dF9jbGllbnQucHVibGlzaChNUVRUX1VTUl9QUkogKyAn5YWJ54WnJywgb25ib2FyZF9hbHNfbC5hbHNfdmlzKCkpCiAgICB0aW1lLnNsZWVwKDUpCg==</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="iot_wifi_connect" id="`|/i8~hDo5}M!,UVkk*G" x="-1378" y="-423"><value name="WIFINAME"><shadow type="text" id="Pq`3QJbEj~ewECVO9[m="><field name="TEXT">fuhua3</field></shadow></value><value name="PASSWORD"><shadow type="text" id="H:A}-6:bFmAvbl{6S$jO"><field name="TEXT">1234567890</field></shadow></value><next><block type="display_show_image_or_string_delay" id="E#~9N`ok;`v!p+JVzd)6"><field name="center">True</field><value name="data"><shadow type="text" id="^[)/vw^xC6v@szyJqjMq"><field name="TEXT">WO</field></shadow></value><value name="space"><shadow type="math_number" id="AC~-*wqwL_[|:-r0KSkr"><field name="NUM">0</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="xh+p}i|E~O[m1P-=maU^"><field name="BOOL">TRUE</field></shadow></value><next><block type="IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE" id="*qPnu*NUuMNDw]bZB`A+"><value name="SERVER"><shadow type="text" id="SxM?H;]!F{08M_w/W4lO"><field name="TEXT">mixio.mixly.cn</field></shadow></value><value name="KEY"><shadow type="iot_mixly_key" id="B+:zx|L^cFFt(XAy9I^E"><field name="VISITOR_ID">768LA26V</field></shadow></value><next><block type="display_show_image_or_string_delay" id="39K6jtwzFw`+|42RpyoP"><field name="center">True</field><value name="data"><shadow type="text" id="ez4[b|0_;Q`c82appjf0"><field name="TEXT">MO</field></shadow></value><value name="space"><shadow type="math_number" id="bp[Wu^qLmaFF)-*,V8B("><field name="NUM">0</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="}x4E7gBxV^v(b@c1FPgU"><field name="BOOL">TRUE</field></shadow></value><next><block type="controls_whileUntil" id="-MVm89xf}afugZ.wMTQw"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="^5wSr`Hkx3Y_jo8R77(u"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_delay_new" id="HW=^$lq6J;5W}Sbon.#U"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id=":$+;/[Y}QqH_6F02`Y=p"><field name="NUM">5</field></shadow></value><next><block type="IOT_MIXIO_PUBLISH" id="En||p,0u8pMUR0.mK-T2"><value name="TOPIC"><shadow type="text" id="Ik]1nR;wQmj1p4#nx5J#"><field name="TEXT">环境</field></shadow></value><value name="MSG"><shadow type="text" id="T7]L_DxyF?^|tp4u}Dvo"><field name="TEXT">msg</field></shadow><block type="IOT_FORMAT_STRING" id="0gr,gl/Y?)N^fX8i`QP-"><value name="VAR"><block type="dicts_create_with_noreturn" id="M4ExW?AjqpUk}*`n?:]P" inline="false"><mutation items="3"></mutation><field name="KEY0">"光照"</field><field name="KEY1">"声音"</field><field name="KEY2">"震动"</field><value name="ADD0"><block type="sensor_mixgo_nova_LTR308" id="?p~Sq4R6O.wa5[gh:`?9"><field name="direction">l</field></block></value><value name="ADD1"><block type="sensor_sound" id=":a,C8X)BeJ7GdA8Dw`LB"></block></value><value name="ADD2"><block type="sensor_get_acceleration" id="ttpE^ryPr_(D~a!Oar]."><field name="key">strength</field></block></value></block></value></block></value></block></next></block></statement></block></next></block></next></block></next></block></next></block></xml><config>{}</config><code>aW1wb3J0IG1peGlvdApmcm9tIG1peGdvX25vdmEgaW1wb3J0IG9uYm9hcmRfdGZ0CmltcG9ydCBtYWNoaW5lCmZyb20gdWJpbmFzY2lpIGltcG9ydCBoZXhsaWZ5CmltcG9ydCB0aW1lCmltcG9ydCBtaXhweQpmcm9tIG1peGdvX25vdmEgaW1wb3J0IG9uYm9hcmRfYWxzX2wKZnJvbSBtaXhnb19ub3ZhX3ZvaWNlIGltcG9ydCBzb3VuZF9sZXZlbApmcm9tIG1peGdvX25vdmEgaW1wb3J0IG9uYm9hcmRfYWNjCgptaXhpb3Qud2xhbl9jb25uZWN0KCdmdWh1YTMnLCAnMTIzNDU2Nzg5MCcpCm9uYm9hcmRfdGZ0LnNob3dzKCdXTycsIHNwYWNlPTAsIGNlbnRlcj1UcnVlLHN5bmM9VHJ1ZSkKTVFUVF9VU1JfUFJKID0gIk1peElPLzc2OExBMjZWL2RlZmF1bHQvIgptcXR0X2NsaWVudCA9IG1peGlvdC5pbml0X01RVFRfY2xpZW50KCdtaXhpby5taXhseS5jbicsICJNaXhJT19wdWJsaWMiLCAiTWl4SU9fcHVibGljIiwgTVFUVF9VU1JfUFJKKQpvbmJvYXJkX3RmdC5zaG93cygnTU8nLCBzcGFjZT0wLCBjZW50ZXI9VHJ1ZSxzeW5jPVRydWUpCndoaWxlIFRydWU6CiAgICB0aW1lLnNsZWVwKDUpCiAgICBtcXR0X2NsaWVudC5wdWJsaXNoKE1RVFRfVVNSX1BSSiArICfnjq/looMnLCBtaXhweS5mb3JtYXRfc3RyKHsi5YWJ54WnIjogb25ib2FyZF9hbHNfbC5hbHNfdmlzKCksICLlo7Dpn7MiOiBzb3VuZF9sZXZlbCgpLCAi6ZyH5YqoIjogb25ib2FyZF9hY2Muc3RyZW5ndGgoKX0pKQo=</code>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-S3@元控青春NOVA"><variables><variable id="x@Yfw8DrgkM3CEl{odMY">client</variable><variable id="Q.[d]Bc~)FuhqVb/l{Uh">topic</variable><variable id="0.A^[Eto)4wE7Tef?SZQ">msg</variable></variables><block type="iot_wifi_connect" id="bT/:3{_!mMLqgco)=Iln" x="-2026" y="-593"><value name="WIFINAME"><shadow type="text" id="J/Mh/Juyz}f^Y/xyOeY^"><field name="TEXT">fuhua3</field></shadow></value><value name="PASSWORD"><shadow type="text" id="xdMSva4MsIMU.c?rPX4c"><field name="TEXT">1234567890</field></shadow></value><next><block type="IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE" id="Z.7h1X^w(QOZxQ@1^U[a"><value name="SERVER"><shadow type="text" id="FLDy/q`TaxV61IQ=uSW]"><field name="TEXT">mixio.mixly.cn</field></shadow></value><value name="KEY"><shadow type="iot_mixly_key" id="S5y[rgVap,$(*/{{fLyx"><field name="VISITOR_ID">4OG7811O</field></shadow></value><next><block type="IOT_MIXIO_SUBSCRIBE" id="{B=nG[l#MyN~iFB-(jF?"><value name="TOPIC"><shadow type="text" id="6k||iGel+0}bjRpp8S7a"><field name="TEXT">亮灯</field></shadow></value><value name="METHOD"><shadow type="factory_block_return" id="e=KV,HOF#bGbfwS]bAJ2"><field name="VALUE">method</field></shadow></value><next><block type="controls_whileUntil" id="Z4=8uD7unYlWdmNzX?~P"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="+I{!.@aML}^4@8Q5PmN?"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="iot_mixio_check" id="Lz$rfC_!23g2,_HQ05F7"></block></statement></block></next></block></next></block></next></block><block type="procedures_defnoreturn" id="uC,C*G#@zb@cXaZaz=[}" x="-2020" y="-282"><mutation><arg name="client" varid="x@Yfw8DrgkM3CEl{odMY"></arg><arg name="topic" varid="Q.[d]Bc~)FuhqVb/l{Uh"></arg><arg name="msg" varid="0.A^[Eto)4wE7Tef?SZQ"></arg></mutation><field name="NAME">method</field><statement name="STACK"><block type="controls_if" id="bbcDC{,3Ms_,fDG5t(/{"><value name="IF0"><block type="logic_compare" id="G7@IobutFArEIOhU+p*p"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="v|/[Kg@F.._H)MG3;,D*"><field name="VAR">msg</field></block></value><value name="B"><block type="text" id="cmTC[Z|ibUUgu]!@CH?c"><field name="TEXT">1</field></block></value></block></value><statement name="DO0"><block type="actuator_onboard_neopixel_rgb_all" id="3NoBv`]nueo]xi()2,.V"><value name="RVALUE"><shadow type="math_number" id="Sh4CK^X+R?uG@zuBLLmA"><field name="NUM">25</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="EJ{Rm*iOj|rWR_l.+2:s"><field name="NUM">25</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="EI^!Ue.gJu(Y]_NJ*p0w"><field name="NUM">25</field></shadow></value><next><block type="actuator_onboard_neopixel_write" id="B3byFcP4u_NwX5!uZS=I"></block></next></block></statement><next><block type="controls_if" id="A.Ut96hvYz{)15PzJBC,"><value name="IF0"><block type="logic_compare" id="P*gWjp01szPgx+|Nv+S:"><field name="OP">EQ</field><value name="A"><block type="variables_get" id=",C;rKW;MjSn8)_pQ(!Y,"><field name="VAR">msg</field></block></value><value name="B"><block type="text" id="3:RG*,k@8{1@auvdUd6)"><field name="TEXT">0</field></block></value></block></value><statement name="DO0"><block type="actuator_onboard_neopixel_rgb_all" id="gF|AGVy-EWi!W~z/83?A"><value name="RVALUE"><shadow type="math_number" id="mOY*,lDVho]rX*hsayju"><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="P##p?aC~F:du7}vtJ?WF"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="@vkMaK`WI}@r1fy;I}wV"><field name="NUM">0</field></shadow></value><next><block type="actuator_onboard_neopixel_write" id="9]hP``r])Y(-wPTh:yl{"></block></next></block></statement></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1peGlvdAppbXBvcnQgbWFjaGluZQpmcm9tIHViaW5hc2NpaSBpbXBvcnQgaGV4bGlmeQpmcm9tIG1peGdvX25vdmEgaW1wb3J0IG9uYm9hcmRfcmdiCgpkZWYgbWV0aG9kKGNsaWVudCwgdG9waWMsIG1zZyk6CiAgICBpZiBtc2cgPT0gJzEnOgogICAgICAgIG9uYm9hcmRfcmdiLmZpbGwoKDI1LCAyNSwgMjUpKQogICAgICAgIG9uYm9hcmRfcmdiLndyaXRlKCkKICAgIGlmIG1zZyA9PSAnMCc6CiAgICAgICAgb25ib2FyZF9yZ2IuZmlsbCgoMCwgMCwgMCkpCiAgICAgICAgb25ib2FyZF9yZ2Iud3JpdGUoKQoKCgptaXhpb3Qud2xhbl9jb25uZWN0KCdmdWh1YTMnLCcxMjM0NTY3ODkwJykKTVFUVF9VU1JfUFJKID0gIk1peElPLzRPRzc4MTFPL2RlZmF1bHQvIgptcXR0X2NsaWVudCA9IG1peGlvdC5pbml0X01RVFRfY2xpZW50KCdtaXhpby5taXhseS5jbicsICJNaXhJT19wdWJsaWMiLCAiTWl4SU9fcHVibGljIiwgTVFUVF9VU1JfUFJKKQptcXR0X2NsaWVudC5zZXRfY2FsbGJhY2soJ+S6rueBrycsbWV0aG9kLCBNUVRUX1VTUl9QUkopCm1xdHRfY2xpZW50LnN1YnNjcmliZShNUVRUX1VTUl9QUkogKyAn5Lqu54GvJykKd2hpbGUgVHJ1ZToKICAgIG1xdHRfY2xpZW50LmNoZWNrX21zZygpCg==</code>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
<xml version="Mixly 3.0 rc0" board="Python ESP32-S3@元控青春NOVA" shown="block"><block type="system_print" id="Xjq,ituFo:L=(L)S55JN" x="-1372" y="-566"><value name="VAR"><shadow type="text" id="T=TQRxPfMG@ZqJU{l.GX"><field name="TEXT">Mixly</field></shadow><block type="storage_list_all_files" id="uBt^PwE(S)M5;yE^}.C."></block></value><next><block type="system_print" id="CA_M!a_5Z5.=aVDw1sU3"><value name="VAR"><shadow type="text" id="9h2-lJe,U52#2ZLY|F8p"><field name="TEXT">Mixly</field></shadow><block type="storage_get_current_dir" id="|f^q3W3_h*MC-)ZLJhp0"></block></value><next><block type="variables_set" id="z*Za#jHbw-vCDDjlZd`b"><field name="VAR">s</field><value name="VALUE"><block type="storage_list_all_files" id="BR}`dpD$`sztI5mj57??"></block></value><next><block type="controls_forEach" id=",rWMv^pB{4B~0|c:_SP~"><value name="LIST"><shadow type="list_many_input" id="GpZK.*t2QbX:EkrB@G8r"><field name="CONTENT">0,1,2,3</field></shadow><block type="controls_range" id="?S^kqiB.Hot]G#JE$7rA"><value name="FROM"><shadow type="math_number" id="l]2)~z~5K]L.otAe_E!O"><field name="NUM">0</field></shadow></value><value name="TO"><shadow type="math_number" id="NJSAY[D:^j!.wG5b:B]#"><field name="NUM">5</field></shadow><block type="list_trig" id="Lmk^jcvIdn,upEO,x0_A"><field name="OP">LEN</field><value name="data"><shadow type="variables_get" id="m{mNOSzf$Z*W..e=9c)W"><field name="VAR">s</field></shadow></value></block></value><value name="STEP"><shadow type="math_number" id="HLI(cb~Pt[]L(LrTqFV!"><field name="NUM">1</field></shadow></value></block></value><value name="VAR"><shadow type="variables_get" id="i[o_fKI[BiT@km+8OuHt"><field name="VAR">i</field></shadow></value><statement name="DO"><block type="onboard_tft_show_image_or_string_delay" id="@X6`pRO1tGU^=HQaTvaW"><field name="center">False</field><value name="data"><shadow type="text" id="Z`wrbd4v-.*Ihg`B^Hk-"><field name="TEXT">Mixly</field></shadow><block type="lists_get_index" id="UGKC`k_I8?+Nh=pNao6*"><value name="LIST"><shadow type="variables_get" id="w((7pU6|cw(R,T8=k.I]"><field name="VAR">s</field></shadow></value><value name="AT"><shadow type="math_number" id="dx{v19o^2..~uB=.5aPT"><field name="NUM">0</field></shadow><block type="variables_get" id="YK@7?[qQM_tQAOXhv030"><field name="VAR">i</field></block></value></block></value><value name="x"><shadow type="math_number" id=",ehw.]=qq=-$k7Hk,^-{"><field name="NUM">0</field></shadow></value><value name="y"><shadow type="math_number" id="8?f=[Q$:F^~@/uB(IpF9"><field name="NUM">0</field></shadow><block type="math_arithmetic" id="jT/9;R+S+2zV(q5M|pfY"><field name="OP">MULTIPLY</field><value name="A"><shadow type="math_number" id="OM]=e3tg^^s?JvIv:2!g"><field name="NUM">1</field></shadow><block type="variables_get" id="41^t#V=Lc^xcjDv,?pj9"><field name="VAR">i</field></block></value><value name="B"><shadow type="math_number" id="#DknrA3OVVLjD2@.6Mpv"><field name="NUM">12</field></shadow></value></block></value><value name="size"><shadow type="math_number" id=".*WB:VBq?p:_;4~(Mr.A"><field name="NUM">1</field></shadow></value><value name="space"><shadow type="math_number" id="8{HU-DRLZWM$L5=K[y[O"><field name="NUM">0</field></shadow></value><value name="VAR"><shadow type="tuple_create_with_text_return" id="j1A1f^C4v;g-pQhqaqb8"><field name="TEXT">255,255,0</field></shadow><block type="display_color_seclet" id="e6k4d(Y4P{2re@qO=Diw"><field name="COLOR">#ffffff</field></block></value><value name="boolean"><shadow type="logic_boolean" id="xh+p}i|E~O[m1P-=maU^"><field name="BOOL">TRUE</field></shadow></value></block></statement></block></next></block></next></block></next></block></xml><config>{}</config><code>aW1wb3J0IG1hY2hpbmUKaW1wb3J0IG9zCmltcG9ydCBtYXRoCmZyb20gbWl4Z29fbm92YSBpbXBvcnQgb25ib2FyZF90ZnQKCnByaW50KG9zLmxpc3RkaXIoKSkKcHJpbnQob3MuZ2V0Y3dkKCkpCnMgPSBvcy5saXN0ZGlyKCkKZm9yIGkgaW4gcmFuZ2UoMCwgbGVuKHMpLCAxKToKICAgIG9uYm9hcmRfdGZ0LnNob3dzKHNbaV0sIHg9MCwgeT1pICogMTIsIHNpemU9MSwgc3BhY2U9MCwgY2VudGVyPUZhbHNlLCBjb2xvcj0weGZmZmYsc3luYz1UcnVlKQo=</code>

Some files were not shown because too many files have changed in this diff Show More