初始化提交

This commit is contained in:
王立帮
2024-07-19 10:16:00 +08:00
parent 4c7b571f20
commit 4a2d56dcc4
7084 changed files with 741212 additions and 63 deletions

View File

@@ -0,0 +1,919 @@
# MicroPython Human Interface Device library
from micropython import const
import struct
import bluetooth
import json
import binascii
from bluetooth import UUID
F_READ = bluetooth.FLAG_READ
F_WRITE = bluetooth.FLAG_WRITE
F_READ_WRITE = bluetooth.FLAG_READ | bluetooth.FLAG_WRITE
F_READ_NOTIFY = bluetooth.FLAG_READ | bluetooth.FLAG_NOTIFY
ATT_F_READ = 0x01
ATT_F_WRITE = 0x02
_ADV_TYPE_FLAGS = const(0x01)
_ADV_TYPE_NAME = const(0x09)
_ADV_TYPE_UUID16_COMPLETE = const(0x3)
_ADV_TYPE_UUID32_COMPLETE = const(0x5)
_ADV_TYPE_UUID128_COMPLETE = const(0x7)
_ADV_TYPE_UUID16_MORE = const(0x2)
_ADV_TYPE_UUID32_MORE = const(0x4)
_ADV_TYPE_UUID128_MORE = const(0x6)
_ADV_TYPE_APPEARANCE = const(0x19)
# IRQ peripheral role event codes
_IRQ_CENTRAL_CONNECT = const(1)
_IRQ_CENTRAL_DISCONNECT = const(2)
_IRQ_GATTS_WRITE = const(3)
_IRQ_GATTS_READ_REQUEST = const(4)
_IRQ_SCAN_RESULT = const(5)
_IRQ_SCAN_DONE = const(6)
_IRQ_PERIPHERAL_CONNECT = const(7)
_IRQ_PERIPHERAL_DISCONNECT = const(8)
_IRQ_GATTC_SERVICE_RESULT = const(9)
_IRQ_GATTC_SERVICE_DONE = const(10)
_IRQ_GATTC_CHARACTERISTIC_RESULT = const(11)
_IRQ_GATTC_CHARACTERISTIC_DONE = const(12)
_IRQ_GATTC_DESCRIPTOR_RESULT = const(13)
_IRQ_GATTC_DESCRIPTOR_DONE = const(14)
_IRQ_GATTC_READ_RESULT = const(15)
_IRQ_GATTC_READ_DONE = const(16)
_IRQ_GATTC_WRITE_DONE = const(17)
_IRQ_GATTC_NOTIFY = const(18)
_IRQ_GATTC_INDICATE = const(19)
_IRQ_GATTS_INDICATE_DONE = const(20)
_IRQ_MTU_EXCHANGED = const(21)
_IRQ_L2CAP_ACCEPT = const(22)
_IRQ_L2CAP_CONNECT = const(23)
_IRQ_L2CAP_DISCONNECT = const(24)
_IRQ_L2CAP_RECV = const(25)
_IRQ_L2CAP_SEND_READY = const(26)
_IRQ_CONNECTION_UPDATE = const(27)
_IRQ_ENCRYPTION_UPDATE = const(28)
_IRQ_GET_SECRET = const(29)
_IRQ_SET_SECRET = const(30)
_IRQ_PASSKEY_ACTION = const(31)
_IO_CAPABILITY_DISPLAY_ONLY = const(0)
_IO_CAPABILITY_DISPLAY_YESNO = const(1)
_IO_CAPABILITY_KEYBOARD_ONLY = const(2)
_IO_CAPABILITY_NO_INPUT_OUTPUT = const(3)
_IO_CAPABILITY_KEYBOARD_DISPLAY = const(4)
_PASSKEY_ACTION_INPUT = const(2)
_PASSKEY_ACTION_DISP = const(3)
_PASSKEY_ACTION_NUMCMP = const(4)
class Advertiser:
# Generate a payload to be passed to gap_advertise(adv_data=...).
def advertising_payload(self, limited_disc=False, br_edr=False, name=None, services=None, appearance=0):
payload = bytearray()
def _append(adv_type, value):
nonlocal payload
payload += struct.pack("BB", len(value) + 1, adv_type) + value
_append(
_ADV_TYPE_FLAGS,
struct.pack("B", (0x01 if limited_disc else 0x02) + (0x18 if br_edr else 0x04)),
)
if name:
_append(_ADV_TYPE_NAME, name)
if services:
for uuid in services:
b = bytes(uuid)
if len(b) == 2:
_append(_ADV_TYPE_UUID16_COMPLETE, b)
elif len(b) == 4:
_append(_ADV_TYPE_UUID32_COMPLETE, b)
elif len(b) == 16:
_append(_ADV_TYPE_UUID128_COMPLETE, b)
# See org.bluetooth.characteristic.gap.appearance.xml
if appearance:
_append(_ADV_TYPE_APPEARANCE, struct.pack("<h", appearance))
return payload
def decode_field(self, payload, adv_type):
i = 0
result = []
while i + 1 < len(payload):
if payload[i + 1] == adv_type:
result.append(payload[i + 2 : i + payload[i] + 1])
i += 1 + payload[i]
return result
def decode_name(self, payload):
n = self.decode_field(payload, _ADV_TYPE_NAME)
return str(n[0], "utf-8") if n else ""
def decode_services(self, payload):
services = []
for u in self.decode_field(payload, _ADV_TYPE_UUID16_COMPLETE):
services.append(bluetooth.UUID(struct.unpack("<h", u)[0]))
for u in self.decode_field(payload, _ADV_TYPE_UUID32_COMPLETE):
services.append(bluetooth.UUID(struct.unpack("<d", u)[0]))
for u in self.decode_field(payload, _ADV_TYPE_UUID128_COMPLETE):
services.append(bluetooth.UUID(u))
return services
# Init as generic HID device (960 = generic HID appearance value)
def __init__(self, ble, services=[UUID(0x1812)], appearance=const(960), name="Generic HID Device"):
self._ble = ble
self._payload = self.advertising_payload(name=name, services=services, appearance=appearance)
self.advertising = False
print("Advertiser created: ", self.decode_name(self._payload), " with services: ", self.decode_services(self._payload))
# Start advertising at 100000 interval
def start_advertising(self):
if not self.advertising:
self._ble.gap_advertise(100000, adv_data=self._payload)
print("Started advertising")
# Stop advertising by setting interval of 0
def stop_advertising(self):
if self.advertising:
self._ble.gap_advertise(0, adv_data=self._payload)
print("Stopped advertising")
# Class that represents a general HID device services
class HumanInterfaceDevice(object):
DEVICE_STOPPED = const(0)
DEVICE_IDLE = const(1)
DEVICE_ADVERTISING = const(2)
DEVICE_CONNECTED = const(3)
def __init__(self, device_name="Generic HID Device"):
self._ble = bluetooth.BLE()
self.adv = None
self.device_state = HumanInterfaceDevice.DEVICE_STOPPED
self.conn_handle = None
self.state_change_callback = None
self.io_capability = _IO_CAPABILITY_NO_INPUT_OUTPUT
self.bond = False
self.le_secure = False
print("Server created")
self.device_name = device_name
self.service_uuids = [UUID(0x180A), UUID(0x180F), UUID(0x1812)] # Service UUIDs: DIS, BAS, HIDS
self.device_appearance = 960 # Generic HID Appearance
self.battery_level = 100
self.model_number = "1"
self.serial_number = "1"
self.firmware_revision = "1"
self.hardware_revision = "1"
self.software_revision = "1"
self.manufacture_name = "Homebrew"
self.pnp_manufacturer_source = 0x01 # Bluetooth uuid list
self.pnp_manufacturer_uuid = 0xFE61 # 0xFEB2 for Microsoft, 0xFE61 for Logitech, 0xFD65 for Razer
self.pnp_product_id = 0x01 # ID 1
self.pnp_product_version = 0x0123 # Version 1.2.3
self.DIS = ( # Device Information Service description
UUID(0x180A), # Device Information
(
(UUID(0x2A24), F_READ), # Model number string
(UUID(0x2A25), F_READ), # Serial number string
(UUID(0x2A26), F_READ), # Firmware revision string
(UUID(0x2A27), F_READ), # Hardware revision string
(UUID(0x2A28), F_READ), # Software revision string
(UUID(0x2A29), F_READ), # Manufacturer name string
(UUID(0x2A50), F_READ), # PnP ID
),
)
self.BAS = ( # Battery Service description
UUID(0x180F), # Device Information
(
(UUID(0x2A19), F_READ_NOTIFY), # Battery level
),
)
self.services = [self.DIS, self.BAS] # List of service descriptions, append HIDS
self.HID_INPUT_REPORT = None
# Passkey for pairing
# Only used when io capability allows so
self.passkey = 1234
# Key store for bonding
self.keys = {}
# Load known keys
self.load_secrets()
# Interrupt request callback function
def ble_irq(self, event, data):
if event == _IRQ_CENTRAL_CONNECT: # Central connected
self.conn_handle, _, _ = data # Save the handle
print("Central connected: ", self.conn_handle)
self.set_state(HumanInterfaceDevice.DEVICE_CONNECTED) # (HIDS specification only allow one central to be connected)
elif event == _IRQ_CENTRAL_DISCONNECT: # Central disconnected
self.conn_handle = None # Discard old handle
conn_handle, addr_type, addr = data
print("Central disconnected: ", conn_handle)
self.set_state(HumanInterfaceDevice.DEVICE_IDLE)
elif event == _IRQ_MTU_EXCHANGED: # MTU was set
conn_handle, mtu = data
self._ble.config(mtu=mtu)
print("MTU exchanged: ", mtu)
elif event == _IRQ_CONNECTION_UPDATE: # Connection parameters were updated
self.conn_handle, _, _, _, _ = data # The new parameters
print("Connection update")
elif event == _IRQ_ENCRYPTION_UPDATE: # Encryption updated
conn_handle, encrypted, authenticated, bonded, key_size = data
print("encryption update", conn_handle, encrypted, authenticated, bonded, key_size)
elif event == _IRQ_PASSKEY_ACTION: # Passkey actions: accept connection or show/enter passkey
conn_handle, action, passkey = data
print("passkey action", conn_handle, action, passkey)
if action == _PASSKEY_ACTION_NUMCMP: # Do we accept this connection?
accept = False
if self.passkey_callback is not None: # Is callback function set?
accept = self.passkey_callback() # Call callback for input
self._ble.gap_passkey(conn_handle, action, accept)
elif action == _PASSKEY_ACTION_DISP: # Show our passkey
print("displaying passkey")
self._ble.gap_passkey(conn_handle, action, self.passkey)
elif action == _PASSKEY_ACTION_INPUT: # Enter passkey
print("prompting for passkey")
pk = None
if self.passkey_callback is not None: # Is callback function set?
pk = self.passkey_callback() # Call callback for input
self._ble.gap_passkey(conn_handle, action, pk)
else:
print("unknown action")
elif event == _IRQ_GATTS_INDICATE_DONE:
conn_handle, value_handle, status = data
print("gatts done: ", conn_handle)
elif event == _IRQ_SET_SECRET: # Set secret for bonding
sec_type, key, value = data
key = sec_type, bytes(key)
value = bytes(value) if value else None
print("set secret: ", key, value)
if value is None: # If value is empty, and
if key in self.keys: # If key is known then
del self.keys[key] # Forget key
self.save_secrets() # Save bonding information
return True
else:
return False
else:
self.keys[key] = value # Remember key/value
self.save_secrets() # Save bonding information
return True
elif event == _IRQ_GET_SECRET: # Get secret for bonding
sec_type, index, key = data
print("get secret: ", sec_type, index, bytes(key) if key else None)
if key is None:
i = 0
for (t, _key), value in self.keys.items():
if t == sec_type:
if i == index:
return value
i += 1
return None
else:
key = sec_type, bytes(key)
return self.keys.get(key, None)
else:
print("Unhandled IRQ event: ", event, data)
# Start the service
# Must be overwritten by subclass, and called in
# the overwritten function by using super(Subclass, self).start()
# io_capability determines whether and how passkeys are used
def start(self):
if self.device_state is HumanInterfaceDevice.DEVICE_STOPPED:
# Set interrupt request callback function
self._ble.irq(self.ble_irq)
# Turn on BLE radio
self._ble.active(1)
# Configure BLE interface
# Set GAP device name
self._ble.config(gap_name=self.device_name)
# Configure MTU
self._ble.config(mtu=23)
# Allow bonding
if self.bond: # calling this on ESP32 is unsupported
self._ble.config(bond=True)
if self.le_secure: # calling these on ESP32 is unsupported
# Require secure pairing
self._ble.config(le_secure=True)
# Require man in the middle protection
self._ble.config(mitm=True)
# Set our input/output capabilities
self._ble.config(io=self.io_capability)
self.set_state(HumanInterfaceDevice.DEVICE_IDLE)
print("BLE on")
# After registering the DIS and BAS services, write their characteristic values
# Must be overwritten by subclass, and called in
# the overwritten function by using
# super(Subclass, self).write_service_characteristics(handles)
def write_service_characteristics(self, handles):
print("Writing service characteristics")
# Get handles to service characteristics
# These correspond directly to self.DIS and sel.BAS
(h_mod, h_ser, h_fwr, h_hwr, h_swr, h_man, h_pnp) = handles[0]
(self.h_bat,) = handles[1]
def string_pack(in_str):
return struct.pack(str(len(in_str))+"s", in_str.encode('UTF-8'))
# Write service characteristics
print("Writing device information service characteristics")
self._ble.gatts_write(h_mod, string_pack(self.model_number))
self._ble.gatts_write(h_ser, string_pack(self.serial_number))
self._ble.gatts_write(h_fwr, string_pack(self.firmware_revision))
self._ble.gatts_write(h_hwr, string_pack(self.hardware_revision))
self._ble.gatts_write(h_swr, string_pack(self.software_revision))
self._ble.gatts_write(h_man, string_pack(self.manufacture_name))
# "<B" is now "<BHHH" basis https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Characteristics/org.bluetooth.characteristic.pnp_id.xml
self._ble.gatts_write(h_pnp, struct.pack("<BHHH", self.pnp_manufacturer_source, self.pnp_manufacturer_uuid, self.pnp_product_id, self.pnp_product_version))
print("Writing battery service characteristics")
# Battery level
self._ble.gatts_write(self.h_bat, struct.pack("<B", self.battery_level))
# Stop the service
def stop(self):
if self.device_state is not HumanInterfaceDevice.DEVICE_STOPPED:
if self.device_state is HumanInterfaceDevice.DEVICE_ADVERTISING:
self.adv.stop_advertising()
if self.conn_handle is not None:
self._ble.gap_disconnect(self.conn_handle)
self.conn_handle = None
self._ble.active(0)
self.set_state(HumanInterfaceDevice.DEVICE_STOPPED)
print("Server stopped")
# Load bonding keys from json file
def load_secrets(self):
try:
with open("keys.json", "r") as file:
entries = json.load(file)
for sec_type, key, value in entries:
self.keys[sec_type, binascii.a2b_base64(key)] = binascii.a2b_base64(value)
except:
print("no secrets available")
# Save bonding keys from json file
def save_secrets(self):
try:
with open("keys.json", "w") as file:
json_secrets = [
(sec_type, binascii.b2a_base64(key), binascii.b2a_base64(value))
for (sec_type, key), value in self.keys.items()
]
json.dump(json_secrets, file)
except:
print("failed to save secrets")
def is_running(self):
return self.device_state is not HumanInterfaceDevice.DEVICE_STOPPED
def is_connected(self):
return self.device_state is HumanInterfaceDevice.DEVICE_CONNECTED
def is_advertising(self):
return self.device_state is HumanInterfaceDevice.DEVICE_ADVERTISING
# Set a new state and notify the user's callback function
def set_state(self, state):
self.device_state = state
if self.state_change_callback is not None:
self.state_change_callback()
def get_state(self):
return self.device_state
def set_state_change_callback(self, callback):
self.state_change_callback = callback
def start_advertising(self):
if self.device_state is not HumanInterfaceDevice.DEVICE_STOPPED and self.device_state is not HumanInterfaceDevice.DEVICE_ADVERTISING:
self.adv.start_advertising()
self.set_state(HumanInterfaceDevice.DEVICE_ADVERTISING)
def stop_advertising(self):
if self.device_state is not HumanInterfaceDevice.DEVICE_STOPPED:
self.adv.stop_advertising()
if self.device_state is not HumanInterfaceDevice.DEVICE_CONNECTED:
self.set_state(HumanInterfaceDevice.DEVICE_IDLE)
def get_device_name(self):
return self.device_name
def get_services_uuids(self):
return self.service_uuids
def get_appearance(self):
return self.device_appearance
def get_battery_level(self):
return self.battery_level
# Sets the value for the battery level
def set_battery_level(self, level):
if level > 100:
self.battery_level = 100
elif level < 0:
self.battery_level = 0
else:
self.battery_level = level
# Set device information
# Must be called before calling Start()
# Variables must be Strings
def set_device_information(self, manufacture_name="Homebrew", model_number="1", serial_number="1"):
self.manufacture_name = manufacture_name
self.model_number = model_number
self.serial_number = serial_number
# Set device revision
# Must be called before calling Start()
# Variables must be Strings
def set_device_revision(self, firmware_revision="1", hardware_revision="1", software_revision="1"):
self.firmware_revision = firmware_revision
self.hardware_revision = hardware_revision
self.software_revision = software_revision
# Set device pnp information
# Must be called before calling Start()
# Must use the following format:
# pnp_manufacturer_source: 0x01 for manufacturers uuid from the Bluetooth uuid list OR 0x02 from the USBs id list
# pnp_manufacturer_uuid: 0xFEB2 for Microsoft, 0xFE61 for Logitech, 0xFD65 for Razer with source 0x01
# pnp_product_id: One byte, user defined
# pnp_product_version: Two bytes, user defined, format as 0xJJMN which corresponds to version JJ.M.N
def set_device_pnp_information(self, pnp_manufacturer_source=0x01, pnp_manufacturer_uuid=0xFE61, pnp_product_id=0x01, pnp_product_version=0x0123):
self.pnp_manufacturer_source = pnp_manufacturer_source
self.pnp_manufacturer_uuid = pnp_manufacturer_uuid
self.pnp_product_id = pnp_product_id
self.pnp_product_version = pnp_product_version
# Set whether to use Bluetooth bonding
def set_bonding(self, bond):
self.bond = bond
# Set whether to use LE secure pairing
def set_le_secure(self, le_secure):
self.le_secure = le_secure
# Set input/output capability of this device
def set_io_capability(self, io_capability):
self.io_capability = io_capability
# Set callback function for pairing events
# Depending on the I/O capability used, the callback function should return either a
# - boolean to accept or deny a connection, or a
# - passkey that was displayed by the main
def set_passkey_callback(self, passkey_callback):
self.passkey_callback = passkey_callback
# Set the passkey used during pairing when entering a passkey at the main
def set_passkey(self, passkey):
self.passkey = passkey
# Notifies the central by writing to the battery level handle
def notify_battery_level(self):
if self.is_connected():
print("Notify battery level: ", self.battery_level)
self._ble.gatts_notify(self.conn_handle, self.h_bat, struct.pack("<B", self.battery_level))
# Notifies the central of the HID state
# Must be overwritten by subclass
def notify_hid_report(self):
return
# Class that represents the Joystick service
class Joystick(HumanInterfaceDevice):
def __init__(self, name="Bluetooth Joystick"):
super(Joystick, self).__init__(name) # Set up the general HID services in super
self.device_appearance = 963 # Device appearance ID, 963 = joystick
self.HIDS = ( # Service description: describes the service and how we communicate
UUID(0x1812), # Human Interface Device
(
(UUID(0x2A4A), F_READ), # HID information
(UUID(0x2A4B), F_READ), # HID report map
(UUID(0x2A4C), F_WRITE), # HID control point
(UUID(0x2A4D), F_READ_NOTIFY, ((UUID(0x2908), ATT_F_READ),)), # HID report / reference
(UUID(0x2A4E), F_READ_WRITE), # HID protocol mode
),
)
# fmt: off
self.HID_INPUT_REPORT = bytes([ # Report Description: describes what we communicate
0x05, 0x01, # USAGE_PAGE (Generic Desktop)
0x09, 0x04, # USAGE (Joystick)
0xa1, 0x01, # COLLECTION (Application)
0x85, 0x01, # REPORT_ID (1)
0xa1, 0x00, # COLLECTION (Physical)
0x09, 0x30, # USAGE (X)
0x09, 0x31, # USAGE (Y)
0x15, 0x81, # LOGICAL_MINIMUM (-127)
0x25, 0x7f, # LOGICAL_MAXIMUM (127)
0x75, 0x08, # REPORT_SIZE (8)
0x95, 0x02, # REPORT_COUNT (2)
0x81, 0x02, # INPUT (Data,Var,Abs)
0x05, 0x09, # USAGE_PAGE (Button)
0x29, 0x08, # USAGE_MAXIMUM (Button 8)
0x19, 0x01, # USAGE_MINIMUM (Button 1)
0x95, 0x08, # REPORT_COUNT (8)
0x75, 0x01, # REPORT_SIZE (1)
0x25, 0x01, # LOGICAL_MAXIMUM (1)
0x15, 0x00, # LOGICAL_MINIMUM (0)
0x81, 0x02, # Input (Data, Variable, Absolute)
0xc0, # END_COLLECTION
0xc0 # END_COLLECTION
])
# fmt: on
# Define the initial joystick state
self.x = 0
self.y = 0
self.button1 = 0
self.button2 = 0
self.button3 = 0
self.button4 = 0
self.button5 = 0
self.button6 = 0
self.button7 = 0
self.button8 = 0
self.services = [self.DIS, self.BAS, self.HIDS] # List of service descriptions
# Overwrite super to register HID specific service
# Call super to register DIS and BAS services
def start(self):
super(Joystick, self).start() # Start super
print("Registering services")
# Register services and get read/write handles for all services
handles = self._ble.gatts_register_services(self.services)
# Write the values for the characteristics
self.write_service_characteristics(handles)
# Create an Advertiser
# Only advertise the top level service, i.e., the HIDS
self.adv = Advertiser(self._ble, [UUID(0x1812)], self.device_appearance, self.device_name)
print("Server started")
# Overwrite super to write HID specific characteristics
# Call super to write DIS and BAS characteristics
def write_service_characteristics(self, handles):
super(Joystick, self).write_service_characteristics(handles)
# Get the handles from the hids, the third service after DIS and BAS
# These correspond directly to self.HIDS
(h_info, h_hid, _, self.h_rep, h_d1, h_proto,) = handles[2]
# Pack the initial joystick state as described by the input report
b = self.button1 + self.button2 * 2 + self.button3 * 4 + self.button4 * 8 + self.button5 * 16 + self.button6 * 32 + self.button7 * 64 + self.button8 * 128
state = struct.pack("bbB", self.x, self.y, b)
print("Writing hid service characteristics")
# Write service characteristics
self._ble.gatts_write(h_info, b"\x01\x01\x00\x02") # HID info: ver=1.1, country=0, flags=normal
self._ble.gatts_write(h_hid, self.HID_INPUT_REPORT) # HID input report map
self._ble.gatts_write(self.h_rep, state) # HID report
self._ble.gatts_write(h_d1, struct.pack("<BB", 1, 1)) # HID reference: id=1, type=input
self._ble.gatts_write(h_proto, b"\x01") # HID protocol mode: report
# Overwrite super to notify central of a hid report
def notify_hid_report(self):
if self.is_connected():
# Pack the joystick state as described by the input report
b = self.button1 + self.button2 * 2 + self.button3 * 4 + self.button4 * 8 + self.button5 * 16 + self.button6 * 32 + self.button7 * 64 + self.button8 * 128
state = struct.pack("bbB", self.x, self.y, b)
print("Notify with report: ", struct.unpack("bbB", state))
# Notify central by writing to the report handle
self._ble.gatts_notify(self.conn_handle, self.h_rep, state)
def set_axes(self, x=0, y=0):
if x > 127:
x = 127
elif x < -127:
x = -127
if y > 127:
y = 127
elif y < -127:
y = -127
self.x = x
self.y = y
def set_buttons(self, b1=0, b2=0, b3=0, b4=0, b5=0, b6=0, b7=0, b8=0):
self.button1 = b1
self.button2 = b2
self.button3 = b3
self.button4 = b4
self.button5 = b5
self.button6 = b6
self.button7 = b7
self.button8 = b8
# Class that represents the Mouse service
class Mouse(HumanInterfaceDevice):
def __init__(self, name="Bluetooth Mouse"):
super(Mouse, self).__init__(name) # Set up the general HID services in super
self.device_appearance = 962 # Device appearance ID, 962 = mouse
self.HIDS = ( # Service description: describes the service and how we communicate
UUID(0x1812), # Human Interface Device
(
(UUID(0x2A4A), F_READ), # HID information
(UUID(0x2A4B), F_READ), # HID report map
(UUID(0x2A4C), F_WRITE), # HID control point
(UUID(0x2A4D), F_READ_NOTIFY, ((UUID(0x2908), ATT_F_READ),)), # HID report / reference
(UUID(0x2A4E), F_READ_WRITE), # HID protocol mode
),
)
# fmt: off
self.HID_INPUT_REPORT = bytes([ # Report Description: describes what we communicate
0x05, 0x01, # USAGE_PAGE (Generic Desktop)
0x09, 0x02, # USAGE (Mouse)
0xa1, 0x01, # COLLECTION (Application)
0x85, 0x01, # REPORT_ID (1)
0x09, 0x01, # USAGE (Pointer)
0xa1, 0x00, # COLLECTION (Physical)
0x05, 0x09, # Usage Page (Buttons)
0x19, 0x01, # Usage Minimum (1)
0x29, 0x03, # Usage Maximum (3)
0x15, 0x00, # Logical Minimum (0)
0x25, 0x01, # Logical Maximum (1)
0x95, 0x03, # Report Count (3)
0x75, 0x01, # Report Size (1)
0x81, 0x02, # Input(Data, Variable, Absolute); 3 button bits
0x95, 0x01, # Report Count(1)
0x75, 0x05, # Report Size(5)
0x81, 0x03, # Input(Constant); 5 bit padding
0x05, 0x01, # Usage Page (Generic Desktop)
0x09, 0x30, # Usage (X)
0x09, 0x31, # Usage (Y)
0x09, 0x38, # Usage (Wheel)
0x15, 0x81, # Logical Minimum (-127)
0x25, 0x7F, # Logical Maximum (127)
0x75, 0x08, # Report Size (8)
0x95, 0x03, # Report Count (3)
0x81, 0x06, # Input(Data, Variable, Relative); 3 position bytes (X,Y,Wheel)
0xc0, # END_COLLECTION
0xc0 # END_COLLECTION
])
# fmt: on
# Define the initial mouse state
self.x = 0
self.y = 0
self.w = 0
self.button1 = 0
self.button2 = 0
self.button3 = 0
self.services = [self.DIS, self.BAS, self.HIDS] # List of service descriptions
# Overwrite super to register HID specific service
# Call super to register DIS and BAS services
def start(self):
super(Mouse, self).start() # Start super
print("Registering services")
# Register services and get read/write handles for all services
handles = self._ble.gatts_register_services(self.services)
# Write the values for the characteristics
self.write_service_characteristics(handles)
# Create an Advertiser
# Only advertise the top level service, i.e., the HIDS
self.adv = Advertiser(self._ble, [UUID(0x1812)], self.device_appearance, self.device_name)
print("Server started")
# Overwrite super to write HID specific characteristics
# Call super to write DIS and BAS characteristics
def write_service_characteristics(self, handles):
super(Mouse, self).write_service_characteristics(handles)
# Get the handles from the hids, the third service after DIS and BAS
# These correspond directly to self.HIDS
(h_info, h_hid, _, self.h_rep, h_d1, h_proto,) = handles[2]
# Pack the initial mouse state as described by the input report
b = self.button1 + self.button2 * 2 + self.button3 * 4
state = struct.pack("Bbbb", b, self.x, self.y, self.w)
print("Writing hid service characteristics")
# Write service characteristics
self._ble.gatts_write(h_info, b"\x01\x01\x00\x02") # HID info: ver=1.1, country=0, flags=normal
self._ble.gatts_write(h_hid, self.HID_INPUT_REPORT) # HID input report map
self._ble.gatts_write(self.h_rep, state) # HID report
self._ble.gatts_write(h_d1, struct.pack("<BB", 1, 1)) # HID reference: id=1, type=input
self._ble.gatts_write(h_proto, b"\x01") # HID protocol mode: report
# Overwrite super to notify central of a hid report
def notify_hid_report(self):
if self.is_connected():
# Pack the mouse state as described by the input report
b = self.button1 + self.button2 * 2 + self.button3* 4
state = struct.pack("Bbbb", b, self.x, self.y, self.w)
print("Notify with report: ", struct.unpack("Bbbb", state))
# Notify central by writing to the report handle
self._ble.gatts_notify(self.conn_handle, self.h_rep, state)
def set_axes(self, x=0, y=0):
if x > 127:
x = 127
elif x < -127:
x = -127
if y > 127:
y = 127
elif y < -127:
y = -127
self.x = x
self.y = y
def set_wheel(self, w=0):
if w > 127:
w = 127
elif w < -127:
w = -127
self.w = w
def set_buttons(self, b1=0, b2=0, b3=0):
self.button1 = b1
self.button2 = b2
self.button3 = b3
# Class that represents the Keyboard service
class Keyboard(HumanInterfaceDevice):
def __init__(self, name="Bluetooth Keyboard"):
super(Keyboard, self).__init__(name) # Set up the general HID services in super
self.device_appearance = 961 # Device appearance ID, 961 = keyboard
self.HIDS = ( # Service description: describes the service and how we communicate
UUID(0x1812), # Human Interface Device
(
(UUID(0x2A4A), F_READ), # HID information
(UUID(0x2A4B), F_READ), # HID report map
(UUID(0x2A4C), F_WRITE), # HID control point
(UUID(0x2A4D), F_READ_NOTIFY, ((UUID(0x2908), ATT_F_READ),)), # HID report / reference
(UUID(0x2A4D), F_READ_WRITE, ((UUID(0x2908), ATT_F_READ),)), # HID report / reference
(UUID(0x2A4E), F_READ_WRITE), # HID protocol mode
),
)
# fmt: off
self.HID_INPUT_REPORT = bytes([ # Report Description: describes what we communicate
0x05, 0x01, # USAGE_PAGE (Generic Desktop)
0x09, 0x06, # USAGE (Keyboard)
0xa1, 0x01, # COLLECTION (Application)
0x85, 0x01, # REPORT_ID (1)
0x75, 0x01, # Report Size (1)
0x95, 0x08, # Report Count (8)
0x05, 0x07, # Usage Page (Key Codes)
0x19, 0xE0, # Usage Minimum (224)
0x29, 0xE7, # Usage Maximum (231)
0x15, 0x00, # Logical Minimum (0)
0x25, 0x01, # Logical Maximum (1)
0x81, 0x02, # Input (Data, Variable, Absolute); Modifier byte
0x95, 0x01, # Report Count (1)
0x75, 0x08, # Report Size (8)
0x81, 0x01, # Input (Constant); Reserved byte
0x95, 0x05, # Report Count (5)
0x75, 0x01, # Report Size (1)
0x05, 0x08, # Usage Page (LEDs)
0x19, 0x01, # Usage Minimum (1)
0x29, 0x05, # Usage Maximum (5)
0x91, 0x02, # Output (Data, Variable, Absolute); LED report
0x95, 0x01, # Report Count (1)
0x75, 0x03, # Report Size (3)
0x91, 0x01, # Output (Constant); LED report padding
0x95, 0x06, # Report Count (6)
0x75, 0x08, # Report Size (8)
0x15, 0x00, # Logical Minimum (0)
0x25, 0x65, # Logical Maximum (101)
0x05, 0x07, # Usage Page (Key Codes)
0x19, 0x00, # Usage Minimum (0)
0x29, 0x65, # Usage Maximum (101)
0x81, 0x00, # Input (Data, Array); Key array (6 bytes)
0xc0 # END_COLLECTION
])
# fmt: on
# Define the initial keyboard state
self.modifiers = 0 # 8 bits signifying Right GUI(Win/Command), Right ALT/Option, Right Shift, Right Control, Left GUI, Left ALT, Left Shift, Left Control
self.keypresses = [0x00] * 6 # 6 keys to hold
# Callback function for keyboard messages from central
self.kb_callback = None
self.services = [self.DIS, self.BAS, self.HIDS] # List of service descriptions
# Interrupt request callback function
# Overwrite super to catch keyboard report write events by the central
def ble_irq(self, event, data):
if event == _IRQ_GATTS_WRITE: # If a client has written to a characteristic or descriptor.
print("Keyboard changed by Central")
conn_handle, attr_handle = data # Get the handle to the characteristic that was written
report = self._ble.gatts_read(attr_handle) # Read the report
bytes = struct.unpack("B", report) # Unpack the report
if self.kb_callback is not None: # Call the callback function
self.kb_callback(bytes)
else: # Else let super handle the event
super(Keyboard, self).ble_irq(event, data)
# Overwrite super to register HID specific service
# Call super to register DIS and BAS services
def start(self):
super(Keyboard, self).start() # Start super
print("Registering services")
# Register services and get read/write handles for all services
handles = self._ble.gatts_register_services(self.services)
# Write the values for the characteristics
self.write_service_characteristics(handles)
# Create an Advertiser
# Only advertise the top level service, i.e., the HIDS
self.adv = Advertiser(self._ble, [UUID(0x1812)], self.device_appearance, self.device_name)
print("Server started")
# Overwrite super to write HID specific characteristics
# Call super to write DIS and BAS characteristics
def write_service_characteristics(self, handles):
super(Keyboard, self).write_service_characteristics(handles)
# Get the handles from the hids, the third service after DIS and BAS
# These correspond directly to self.HIDS
(h_info, h_hid, _, self.h_rep, h_d1, self.h_repout, h_d2, h_proto,) = handles[2]
print("Writing hid service characteristics")
# Write service characteristics
self._ble.gatts_write(h_info, b"\x01\x01\x00\x02") # HID info: ver=1.1, country=0, flags=normal
self._ble.gatts_write(h_hid, self.HID_INPUT_REPORT) # HID input report map
self._ble.gatts_write(h_d1, struct.pack("<BB", 1, 1)) # HID reference: id=1, type=input
self._ble.gatts_write(h_d2, struct.pack("<BB", 1, 2)) # HID reference: id=1, type=output
self._ble.gatts_write(h_proto, b"\x01") # HID protocol mode: report
# Overwrite super to notify central of a hid report
def notify_hid_report(self):
if self.is_connected():
# Pack the Keyboard state as described by the input report
state = struct.pack("8B", self.modifiers, 0, self.keypresses[0], self.keypresses[1], self.keypresses[2], self.keypresses[3], self.keypresses[4], self.keypresses[5])
print("Notify with report: ", struct.unpack("8B", state))
# Notify central by writing to the report handle
self._ble.gatts_notify(self.conn_handle, self.h_rep, state)
# Set the modifier bits, notify to send the modifiers to central
def set_modifiers(self, right_gui=0, right_alt=0, right_shift=0, right_control=0, left_gui=0, left_alt=0, left_shift=0, left_control=0):
self.modifiers = (right_gui << 7) + (right_alt << 6) + (right_shift << 5) + (right_control << 4) + (left_gui << 3) + (left_alt << 2) + (left_shift << 1) + left_control
# Press keys, notify to send the keys to central
# This will hold down the keys, call set_keys() without arguments and notify again to release
def set_keys(self, k0=0x00, k1=0x00, k2=0x00, k3=0x00, k4=0x00, k5=0x00):
self.keypresses = [k0, k1, k2, k3, k4, k5]
# Set a callback function that gets notified on keyboard changes
# Should take a tuple with the report bytes
def set_kb_callback(self, kb_callback):
self.kb_callback = kb_callback

View File

@@ -0,0 +1,55 @@
"""
ME G1 -MixGo ME EXT G1
MicroPython library for the ME G1 (Expansion board for MixGo ME)
=======================================================
#Preliminary composition 20230110
dahanzimin From the Mixly Team
"""
import time,gc
from machine import Pin,SoftI2C,ADC
'''i2c-extboard'''
ext_i2c=SoftI2C(scl = Pin(0), sda = Pin(1), freq = 400000)
Pin(0,Pin.OUT)
'''Atmos_Sensor'''
try :
import hp203x
ext_hp203x = hp203x.HP203X(ext_i2c)
except Exception as e:
print("Warning: Failed to communicate with HP203X or",e)
'''T&H_Sensor'''
try :
import ahtx0
ext_ahtx0 = ahtx0.AHTx0(ext_i2c)
except Exception as e:
print("Warning: Failed to communicate with AHTx0 or",e)
'''RFID_Sensor'''
try :
import rc522
ext_rc522 = rc522.RC522(ext_i2c)
except Exception as e:
print("Warning: Failed to communicate with RC522 or",e)
'''Knob_Sensor'''
def varistor():
adc = ADC(Pin(0))
adc.atten(ADC.ATTN_11DB)
time.sleep_ms(1)
values = []
for _ in range(100):
values.append(adc.read_u16())
time.sleep_us(100)
result = sum(sorted(values)[25:75])//50
Pin(0,Pin.OUT)
time.sleep_ms(1)
return max((result-10100),0)*65535//55435
'''Reclaim memory'''
gc.collect()

View File

@@ -0,0 +1,249 @@
"""
ME GO -Onboard resources
MicroPython library for the ME GO (Smart Car base for MixGo ME)
=======================================================
#Preliminary composition 20220625
dahanzimin From the Mixly Team
"""
import time, gc, math
from tm1931 import TM1931
from machine import Pin, SoftI2C, ADC
'''i2c-onboard'''
i2c = SoftI2C(scl = Pin(7), sda = Pin(6), freq = 400000)
i2c_scan = i2c.scan()
'''Version judgment'''
if 0x50 in i2c_scan:
version = 1
else:
version = 0
'''Judging the type of external motor'''
Mi2c = 0
for addr in i2c_scan:
if addr in [0x30, 0x31, 0x32, 0x33]:
Mi2c = addr
break
'''i2c-motor'''
def i2c_motor(speed):
i2c.writeto(Mi2c, b'\x00\x00' + speed.to_bytes(1, 'little') + b'\x00')
'''TM1931-Expand'''
class CAR(TM1931):
'''Infrared line patrol obstacle avoidance mode'''
CL=0 #Turn off infrared to reduce power consumption
OA=1 #Obstacle avoidance mode only
LP=2 #Line patrol mode only
LS=3 #Light seeking mode only
AS=4 #Automatic mode switching
'''TM1931 port corresponding function definition'''
OAOU=5 #obstacle avoidance
LPOU=4 #Line patrol control
LSOU=3 #Light control
WLED=12 #Headlamp port
GLED=[17,8,6,15] #Green LED port
RLED=[16,7,9,18] #Red LED port
UCOU=[1,2] #Typec external port
MOTO=[[13,14],[10,11],[1,2]] #Motor port
def __init__(self, i2c_bus):
super().__init__(i2c_bus)
self._mode = self.CL
self.atten = 0.82 if version else 1
self.adc0 = ADC(Pin(0), atten=ADC.ATTN_11DB)
self.adc1 = ADC(Pin(1), atten=ADC.ATTN_11DB)
self.adc2 = ADC(Pin(2), atten=ADC.ATTN_11DB)
self.adc3 = ADC(Pin(3), atten=ADC.ATTN_11DB)
def ir_mode(self,select=0):
'''Infrared line patrol obstacle avoidance mode'''
self._mode=select
if select==self.CL:
self.pwm(self.OAOU,0)
self.pwm(self.LPOU,0)
self.pwm(self.LSOU,0)
if select==self.OA:
self.pwm(self.OAOU,255)
self.pwm(self.LPOU,0)
self.pwm(self.LSOU,0)
if select==self.LP:
self.pwm(self.OAOU,0)
self.pwm(self.LPOU,255)
self.pwm(self.LSOU,0)
if select==self.LS:
self.pwm(self.OAOU,0)
self.pwm(self.LPOU,0)
self.pwm(self.LSOU,255)
time.sleep_ms(2)
def obstacle(self):
'''Read the obstacle avoidance sensor'''
if self._mode==self.AS:
self.pwm(self.OAOU,255)
self.pwm(self.LPOU,0)
self.pwm(self.LSOU,0)
time.sleep_ms(2)
if self._mode==self.OA or self._mode==self.AS :
return self.adc2.read_u16(),self.adc1.read_u16(),self.adc0.read_u16(),self.adc3.read_u16()
else:
raise ValueError('Mode selection error, obstacle avoidance data cannot be read')
def patrol(self):
'''Read the line patrol sensor'''
if self._mode==self.AS:
self.pwm(self.OAOU,0)
self.pwm(self.LPOU,255)
self.pwm(self.LSOU,0)
time.sleep_ms(2)
if self._mode==self.LP or self._mode==self.AS:
return self.adc3.read_u16(),self.adc2.read_u16(),self.adc1.read_u16(),self.adc0.read_u16()
else:
raise ValueError('Mode selection error, line patrol data cannot be read')
def light(self):
'''Read the light seeking sensor'''
if self._mode==self.AS:
self.pwm(self.OAOU,0)
self.pwm(self.LPOU,0)
self.pwm(self.LSOU,255)
time.sleep_ms(2)
if self._mode==self.LS or self._mode==self.AS:
return self.adc3.read_u16(),self.adc2.read_u16(),self.adc1.read_u16(),self.adc0.read_u16()
else:
raise ValueError('Mode selection error, light seeking data cannot be read')
def motor(self, index, action, speed=0):
speed = round(max(min(speed, 100), -100) * self.atten)
if action=="N":
if (index == [1, 2]) and Mi2c:
i2c_motor(0)
else:
self.pwm(index[0], 255)
self.pwm(index[1], 255)
elif action=="P":
if (index == [1, 2]) and Mi2c:
i2c_motor(0)
else:
self.pwm(index[0], 0)
self.pwm(index[1], 0)
elif action=="CW":
if (index == [1, 2]) and Mi2c:
i2c_motor(speed)
else:
if speed >= 0:
self.pwm(index[0], speed * 255 // 100)
self.pwm(index[1], 0)
else:
self.pwm(index[0], 0)
self.pwm(index[1], - speed * 255 // 100)
elif action=="CCW":
if (index == [1, 2]) and Mi2c:
i2c_motor(- speed)
else:
if speed >= 0:
self.pwm(index[0], 0)
self.pwm(index[1], speed * 255 // 100)
else:
self.pwm(index[0], - speed * 255 // 100)
self.pwm(index[1], 0)
else:
raise ValueError('Invalid input, valid are "N","P","CW","CCW"')
def move(self,action,speed=100):
if action=="N":
self.motor(self.MOTO[0],"N")
self.motor(self.MOTO[1],"N")
elif action=="P":
self.motor(self.MOTO[0],"P")
self.motor(self.MOTO[1],"P")
elif action=="F":
self.motor(self.MOTO[0],"CCW",speed)
self.motor(self.MOTO[1],"CW",speed)
elif action=="B":
self.motor(self.MOTO[0],"CW",speed)
self.motor(self.MOTO[1],"CCW",speed)
elif action=="L":
self.motor(self.MOTO[0],"CW",speed)
self.motor(self.MOTO[1],"CW",speed)
elif action=="R":
self.motor(self.MOTO[0],"CCW",speed)
self.motor(self.MOTO[1],"CCW",speed)
else:
raise ValueError('Invalid input, valid are "N","P","F","B","L","R"')
def setbrightness(self,index,val):
if not 0 <= val <= 100:
raise ValueError("Brightness must be in the range: 0-100%")
self.pwm(index,val)
def getrightness(self,index):
return self.duty(index)
def setonoff(self,index,val):
if(val == -1):
if self.getrightness(index) < 50:
self.setbrightness(index,100)
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.getrightness(index)>0 else False
try :
car=CAR(i2c) #Including LED,motor,patrol,obstacle
except Exception as e:
print("Warning: Failed to communicate with TM1931 (ME GO CAR) or", e)
'''2Hall_HEP'''
class HALL:
_pulse_turns=1/480 if version else 1/400 #圈数= 1/(减速比*磁极)
_pulse_distance=_pulse_turns*math.pi*4.4 #距离= 圈数*π*轮胎直径
def __init__(self, pin):
self.turns = 0
self.distance = 0 #cm
self._speed = 0 #cm/s
self._on_receive = None
self._time = time.ticks_ms()
Pin(pin, Pin.IN).irq(handler=self._receive_cb, trigger = (Pin.IRQ_RISING | Pin.IRQ_FALLING))
def _receive_cb(self, event_source):
self.turns += self._pulse_turns
self.distance += self._pulse_distance
self._speed += self._pulse_distance
if self._on_receive:
self._on_receive(round(self.turns,2),round(self.distance,2))
def irq_cb(self, callback):
self._on_receive = callback
def initial(self,turns=None,distance=None):
if not (turns is None):
self.turns = turns
if not (distance is None):
self.distance = distance
@property
def speed(self):
value=self._speed/time.ticks_diff(time.ticks_ms(), self._time)*1000 if self._speed>0 else 0
self._time = time.ticks_ms()
self._speed=0
return round(value, 2)
hall_A = HALL(20)
hall_B = HALL(21)
'''Reclaim memory'''
gc.collect()

View File

@@ -0,0 +1,250 @@
"""
MixGo CC -Onboard resources
MicroPython library for the MixGo CC -Onboard resources
=======================================================
#Preliminary composition 20221010
dahanzimin From the Mixly Team
"""
import time, gc
from machine import Pin, SoftI2C, ADC, PWM, RTC
'''i2c-onboard'''
onboard_i2c=SoftI2C(scl = Pin(7), sda = Pin(6), freq = 400000)
onboard_i2c_scan = onboard_i2c.scan()
'''Version judgment'''
if 0x73 in onboard_i2c_scan:
version=1
elif 0x72 in onboard_i2c_scan:
version=0
else:
print("Warning: Mixgo CC board is not detected, which may cause usage errors")
'''RTC'''
rtc_clock=RTC()
'''ACC-Sensor'''
try :
import mxc6655xa
onboard_acc = mxc6655xa.MXC6655XA(onboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with MXC6655XA (ACC) 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)
'''BPS_Sensor'''
if 0x76 in onboard_i2c_scan:
try :
import hp203x
onboard_bps = hp203x.HP203X(onboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with HP203X (BPS) or",e)
if 0x77 in onboard_i2c_scan:
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)
'''T&H_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)
'''matrix32x12'''
try :
import matrix32x12
onboard_matrix = matrix32x12.Matrix(onboard_i2c, address=0x73 if version else 0x72)
except Exception as e:
print("Warning: Failed to communicate with Matrix32X12 or",e)
'''Magnetic'''
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'''
from ws2812 import NeoPixel
onboard_rgb = NeoPixel(Pin(8), 4, ORDER=(0, 1, 2, 3))
'''1Buzzer-Music'''
from music import MIDI
onboard_music =MIDI(10)
'''MIC_Sensor'''
class MICSensor:
def __init__(self,pin):
self.adc=ADC(Pin(pin), atten=ADC.ATTN_11DB)
def read(self):
maxloudness = 0
for i in range(5):
loudness = self.sample()
if loudness > maxloudness:
maxloudness = loudness
return maxloudness
def sample(self):
values = []
for i in range(50):
val = self.adc.read_u16()
values.append(val)
return max(values) - min(values)
onboard_sound = MICSensor(pin=4 if version else 3)
'''4,5KEY_Sensor'''
class KEYSensor:
def __init__(self, pin, range):
self.adc = ADC(Pin(pin), atten=ADC.ATTN_11DB)
self.pin = pin
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 - 300) < min(sorted(values)[25:]) < (self.range + 300)
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)
'''2,1KEY_Button'''
class Button:
def __init__(self, pin):
self.pin = Pin(pin, Pin.IN)
self.flag = True
def get_presses(self, delay = 1):
last_time,presses = time.time(), 0
while time.time() < last_time + delay:
time.sleep(0.05)
if self.was_pressed():
presses += 1
return presses
def is_pressed(self):
return not self.pin.value()
def was_pressed(self, flag = 0):
if(self.pin.value() != self.flag):
self.flag = self.pin.value()
time.sleep(0.02)
if self.flag:
return False
else:
return True
def irq(self, handler, trigger):
self.pin.irq(handler = handler, trigger = trigger)
if version==0:
B1key = Button(9)
B2key = Button(4)
A1key = KEYSensor(2,20)
A2key = KEYSensor(2,1170)
A3key = KEYSensor(2,2400)
A4key = KEYSensor(2,3610)
else:
B1key = Button(9)
B2key = KEYSensor(5,20)
A1key = KEYSensor(5,800)
A2key = KEYSensor(5,1600)
A3key = KEYSensor(5,2500)
A4key = KEYSensor(5,3500)
'''2-LED''' #Modify indexing method
class LED:
def __init__(self, pins=[]):
self._pins = pins
self._flag = [True] * len(pins)
self._brightness = [0] * len(pins)
def setbrightness(self, index, val):
if not 0 <= val <= 100:
raise ValueError("Brightness must be in the range: 0-100%")
if len(self._pins) == 0:
print("Warning: Old version, without this function")
else:
if self._flag[index-1]:
self._pins[index-1] = PWM(Pin(self._pins[index-1]), duty_u16=65535)
self._flag[index-1] = False
self._brightness[index - 1] = val
self._pins[index - 1].duty_u16(65535 - val * 65535 // 100)
def getbrightness(self, index):
if len(self._pins) == 0:
print("Warning: Old version, without this function")
else:
return self._brightness[index - 1]
def setonoff(self, index, val):
if len(self._pins) == 0:
print("Warning: Old version, without this function")
else:
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):
if len(self._pins) == 0:
print("Warning: Old version, without this function")
else:
return True if self.getbrightness(index) > 50 else False
#LED with function call / L1(IO20),L2(IO21)
onboard_led = LED() if version == 0 else LED(pins=[20, 21])
'''Reclaim memory'''
gc.collect()

View File

@@ -0,0 +1,192 @@
"""
MixGo ME -Onboard resources
MicroPython library for the MixGo ME -Onboard resources
=======================================================
#Preliminary composition 20221010
dahanzimin From the Mixly Team
"""
import time, gc
from machine import Pin, SoftI2C, ADC, PWM, RTC
'''i2c-onboard'''
onboard_i2c=SoftI2C(scl = Pin(7), sda = Pin(6), freq = 400000)
'''RTC'''
rtc_clock=RTC()
'''ACC-Sensor'''
try :
import mxc6655xa
onboard_acc = mxc6655xa.MXC6655XA(onboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with MXC6655XA 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 LTR_553ALS or",e)
'''Matrix8x5'''
try :
import matrix8x5
onboard_matrix = matrix8x5.Matrix(8)
except Exception as e:
print("Warning: Failed to communicate with Matrix8x5 or",e)
'''Magnetic'''
try :
import mmc5603
onboard_mgs = mmc5603.MMC5603(onboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with MMC5603 or",e)
'''2RGB_WS2812'''
from ws2812 import NeoPixel
onboard_rgb = NeoPixel(Pin(9), 2, ORDER=(0, 1, 2, 3), multiplex=1)
'''1Buzzer-Music'''
from music import MIDI
onboard_music =MIDI(10)
'''MIC_Sensor'''
class MICSensor:
def __init__(self):
self.adc=ADC(Pin(4), atten=ADC.ATTN_11DB)
def read(self):
maxloudness = 0
for i in range(5):
loudness = self.sample()
if loudness > maxloudness:
maxloudness = loudness
return maxloudness
def sample(self):
values = []
for i in range(50):
val = self.adc.read_u16()
values.append(val)
return max(values) - min(values)
onboard_sound = MICSensor()
'''5KEY_Sensor'''
class KEYSensor:
def __init__(self,range):
self.adc=ADC(Pin(5), atten=ADC.ATTN_11DB)
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 - 300) < min(sorted(values)[25:]) < (self.range + 300)
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(5, Pin.IN).irq(handler = handler, trigger = trigger)
B2key = KEYSensor(20)
A1key = KEYSensor(800)
A2key = KEYSensor(1600)
A3key = KEYSensor(2500)
A4key = KEYSensor(3500)
'''1KEY_Button'''
class Button:
def __init__(self, pin):
self.pin = Pin(pin, Pin.IN)
self.flag = True
def get_presses(self, delay = 1):
last_time,presses = time.time(), 0
while time.time() < last_time + delay:
time.sleep(0.05)
if self.was_pressed():
presses += 1
return presses
def is_pressed(self):
return not self.pin.value()
def was_pressed(self, flag = 0):
if(self.pin.value() != self.flag):
self.flag = self.pin.value()
time.sleep(0.02)
if self.flag:
return False
else:
return True
def irq(self, handler, trigger):
self.pin.irq(handler = handler, trigger = trigger)
B1key = Button(9)
'''2LED-Multiplex RGB'''
class LED:
def __init__(self, rgb, num=2, color=3):
self._rgb = rgb
self._col = [color] * num
self._color = ((0, 0, 0), (1, 0, 0), (0, 1, 0), (0, 0, 1), (1, 1, 0), (0, 1, 1), (1, 0, 1), (1, 1, 1))
def setbrightness(self, index, value):
self._rgb[index - 1] = (value if self._color[self._col[index-1]][0] else 0,
value if self._color[self._col[index-1]][1] else 0,
value if self._color[self._col[index-1]][2] else 0)
self._rgb.write()
def getbrightness(self, index):
color = self._rgb[index - 1]
return color[0] | color[1] | color[2]
def setonoff(self, index, value):
if value == -1:
if self.getbrightness(index) < 50:
self.setbrightness(index, 100)
else:
self.setbrightness(index, 0)
elif value == 1:
self.setbrightness(index, 100)
elif value == 0:
self.setbrightness(index, 0)
def getonoff(self, index):
return True if self.getbrightness(index) > 50 else False
def setcolor(self, index, color):
self._col[index-1] = color
def getcolor(self, index):
return self._col[index-1]
onboard_led=LED(onboard_rgb)
'''Reclaim memory'''
gc.collect()

View File

@@ -0,0 +1,254 @@
"""
MixGo CAR -Onboard resources
MicroPython library for the MixGo CAR (ESP32C3)
=======================================================
#Preliminary composition 20220804
dahanzimin From the Mixly Team
"""
import time,gc,ms32006
from machine import Pin,SoftI2C,ADC,RTC
'''RTC'''
rtc_clock=RTC()
'''i2c-onboard'''
onboard_i2c=SoftI2C(scl = Pin(7), sda = Pin(6), freq = 400000)
'''4RGB_WS2812''' #color_chase(),rainbow_cycle()方法移至类里
from ws2812 import NeoPixel
onboard_rgb = NeoPixel(Pin(8), 4, ORDER=(0, 1, 2, 3))
'''1Buzzer-Music'''
from music import MIDI
onboard_music =MIDI(5)
'''1KEY_Button'''
class Button:
def __init__(self, pin):
self.pin = Pin(pin, Pin.IN)
self.flag = True
def get_presses(self, delay = 1):
last_time, last_state, presses = time.time(), 0, 0
while time.time() < last_time + delay:
time.sleep_ms(50)
if last_state == 0 and self.pin.value() == 1:
last_state = 1
if last_state == 1 and self.pin.value() == 0:
last_state, presses = 0, presses + 1
return presses
def is_pressed(self):
return not self.pin.value()
def was_pressed(self, flag = 0):
if(self.pin.value() != self.flag):
self.flag = self.pin.value()
time.sleep(0.02)
if self.flag:
return False
else:
return True
def irq(self, handler, trigger):
self.pin.irq(handler = handler, trigger = trigger)
button = Button(9)
'''MS32006-Drive'''
class CAR:
MOTO_R =1
MOTO_R1 =0
MOTO_R2 =7
MOTO_L =2
MOTO_L1 =4
MOTO_L2 =3
def __init__(self, i2c_bus):
self.motor_a=ms32006.MS32006(i2c_bus,ms32006.ADDRESS_A)
self.motor_b=ms32006.MS32006(i2c_bus,ms32006.ADDRESS_B)
self.motor_move("P")
def motor(self,index,action,speed=0):
if action=="N":
if index==self.MOTO_R:
self.motor_a.dc_motor(ms32006.MOT_N,speed)
if index==self.MOTO_L:
self.motor_b.dc_motor(ms32006.MOT_N,speed)
elif action=="P":
if index==self.MOTO_R:
self.motor_a.dc_motor(ms32006.MOT_P,speed)
if index==self.MOTO_L:
self.motor_b.dc_motor(ms32006.MOT_P,speed)
elif action=="CW":
if index==self.MOTO_R:
self.motor_a.dc_motor(ms32006.MOT_CW,speed)
if index==self.MOTO_L:
self.motor_b.dc_motor(ms32006.MOT_CW,speed)
elif action=="CCW":
if index==self.MOTO_R:
self.motor_a.dc_motor(ms32006.MOT_CCW,speed)
if index==self.MOTO_L:
self.motor_b.dc_motor(ms32006.MOT_CCW,speed)
else:
raise ValueError('Invalid input, valid are "N","P","CW","CCW"')
def stepper(self,index,action,mot_pps,mot_step):
if action=="N":
if index==self.MOTO_R1 or index==self.MOTO_L1:
self.motor_a.close(index)
if index==self.MOTO_R2 or index==self.MOTO_L2:
self.motor_b.close(index-3)
elif action=="P":
if index==self.MOTO_R1 or index==self.MOTO_L1:
self.motor_a.stop(index)
if index==self.MOTO_R2 or index==self.MOTO_L2:
self.motor_b.stop(index-3)
elif action=="CW":
if index==self.MOTO_R1 or index==self.MOTO_L1:
self.motor_a.move(index,ms32006.MOT_CW,mot_pps,mot_step)
if index==self.MOTO_R2 or index==self.MOTO_L2:
self.motor_b.move(index-3,ms32006.MOT_CW,mot_pps,mot_step)
elif action=="CCW":
if index==self.MOTO_R1 or index==self.MOTO_L1:
self.motor_a.move(index,ms32006.MOT_CCW,mot_pps,mot_step)
if index==self.MOTO_R2 or index==self.MOTO_L2:
self.motor_b.move(index-3,ms32006.MOT_CCW,mot_pps,mot_step)
else:
raise ValueError('Invalid input, valid are "N","P","CW","CCW"')
def stepper_readwork(self,index):
if index==self.MOTO_R1 or index==self.MOTO_L1:
return self.motor_a.readwork(index)
if index==self.MOTO_R2 or index==self.MOTO_L2:
return self.motor_b.readwork(index-3)
def stepper_move(self,action,mot_pps,mot_step):
if action=="N":
self.motor_a.close(self.MOTO_R1)
self.motor_a.close(self.MOTO_R2-3)
self.motor_b.close(self.MOTO_L1)
self.motor_b.close(self.MOTO_L2-3)
elif action=="P":
self.motor_a.stop(self.MOTO_R1)
self.motor_a.stop(self.MOTO_R2-3)
self.motor_b.stop(self.MOTO_L1)
self.motor_b.stop(self.MOTO_L2-3)
elif action=="F":
self.motor_a.move(self.MOTO_R1,ms32006.MOT_CW,mot_pps,mot_step)
self.motor_a.move(self.MOTO_R2-3,ms32006.MOT_CCW,mot_pps,mot_step)
self.motor_b.move(self.MOTO_L1,ms32006.MOT_CW,mot_pps,mot_step)
self.motor_b.move(self.MOTO_L2-3,ms32006.MOT_CCW,mot_pps,mot_step)
elif action=="B":
self.motor_a.move(self.MOTO_R1,ms32006.MOT_CCW,mot_pps,mot_step)
self.motor_a.move(self.MOTO_R2-3,ms32006.MOT_CW,mot_pps,mot_step)
self.motor_b.move(self.MOTO_L1,ms32006.MOT_CCW,mot_pps,mot_step)
self.motor_b.move(self.MOTO_L2-3,ms32006.MOT_CW,mot_pps,mot_step)
elif action=="L":
self.motor_a.move(self.MOTO_R1,ms32006.MOT_CCW,mot_pps,mot_step)
self.motor_a.move(self.MOTO_R2-3,ms32006.MOT_CCW,mot_pps,mot_step)
self.motor_b.move(self.MOTO_L1,ms32006.MOT_CCW,mot_pps,mot_step)
self.motor_b.move(self.MOTO_L2-3,ms32006.MOT_CCW,mot_pps,mot_step)
elif action=="R":
self.motor_a.move(self.MOTO_R1,ms32006.MOT_CW,mot_pps,mot_step)
self.motor_a.move(self.MOTO_R2-3,ms32006.MOT_CW,mot_pps,mot_step)
self.motor_b.move(self.MOTO_L1,ms32006.MOT_CW,mot_pps,mot_step)
self.motor_b.move(self.MOTO_L2-3,ms32006.MOT_CW,mot_pps,mot_step)
else:
raise ValueError('Invalid input, valid are "N","P","F","B","L","R"')
def motor_move(self,action,speed=100):
if action=="N":
self.motor_a.dc_motor(ms32006.MOT_N,speed)
self.motor_b.dc_motor(ms32006.MOT_N,speed)
elif action=="P":
self.motor_a.dc_motor(ms32006.MOT_P,speed)
self.motor_b.dc_motor(ms32006.MOT_P,speed)
elif action=="F":
self.motor_a.dc_motor(ms32006.MOT_CCW,speed)
self.motor_b.dc_motor(ms32006.MOT_CW,speed)
elif action=="B":
self.motor_a.dc_motor(ms32006.MOT_CW,speed)
self.motor_b.dc_motor(ms32006.MOT_CCW,speed)
elif action=="L":
self.motor_a.dc_motor(ms32006.MOT_CCW,speed)
self.motor_b.dc_motor(ms32006.MOT_CCW,speed)
elif action=="R":
self.motor_a.dc_motor(ms32006.MOT_CW,speed)
self.motor_b.dc_motor(ms32006.MOT_CW,speed)
else:
raise ValueError('Invalid input, valid are "N","P","F","B","L","R"')
try :
car=CAR(onboard_i2c) #Including LED,motor,patrol,obstacle
except Exception as e:
print("Warning: Failed to communicate with MS32006 or",e)
'''IRtube-Drive'''
class IRtube:
OA=1 #Obstacle avoidance mode only
LP=2 #Line patrol mode only
AS=3 #Automatic mode switching
def __init__(self):
#auto是否手动切换模拟开关转换
self.adc0 = ADC(Pin(0))
self.adc1 = ADC(Pin(1))
self.adc2 = ADC(Pin(3))
self.adc3 = ADC(Pin(4))
self.adc0.atten(ADC.ATTN_11DB)
self.adc1.atten(ADC.ATTN_11DB)
self.adc2.atten(ADC.ATTN_11DB)
self.adc3.atten(ADC.ATTN_11DB)
self.convert=Pin(2, Pin.OUT)
self._mode=self.AS
def read_bat(self):
#读电池电量,返回电压值
self.convert = ADC(Pin(2))
self.convert.atten(ADC.ATTN_11DB)
time.sleep_ms(5)
bat_adc=self.convert.read()*0.0011
time.sleep_ms(5)
self.convert=Pin(2, Pin.OUT)
return bat_adc
def obstacle(self):
#读避障传感器,返回前左、右后左、右ADC值
if self._mode==self.AS:
self.convert.value(0)
time.sleep_ms(2)
if self._mode==self.OA or self._mode==self.AS :
return self.adc1.read_u16(),self.adc2.read_u16(),self.adc3.read_u16(),self.adc0.read_u16()
else:
raise ValueError('In line patrol mode, obstacle avoidance data cannot be read')
def patrol(self):
#读巡线传感器,返回左、中左、中右、右ADC值
if self._mode==self.AS:
self.convert.value(1)
time.sleep_ms(2)
if self._mode==self.LP or self._mode==self.AS:
return self.adc0.read_u16(),self.adc1.read_u16(),self.adc2.read_u16(),self.adc3.read_u16()
else:
raise ValueError('In obstacle avoidance mode, line patrol data cannot be read')
def ir_mode(self,select=0):
#切换模式
self._mode=select
if select==self.OA:
self.convert.value(0)
if select==self.LP:
self.convert.value(1)
time.sleep_ms(2)
onboard_info = IRtube()
'''Reclaim memory'''
gc.collect()

View File

@@ -0,0 +1,118 @@
{
"board": {
"MixGo ME": "micropython:esp32c3:mixgo_me",
"MixGo CC": "micropython:esp32c3:mixgo_cc",
"MixGo Car 4.2": "micropython:esp32c3:mixgocar_c3",
"ESP32C3 Generic(UART)": "micropython:esp32c3:generic"
},
"language": "MicroPython",
"burn": {
"type": "command",
"portSelect": "all",
"micropython:esp32c3:mixgo_cc": {
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud 460800 erase_flash && \"{esptool}\" --chip esp32c3 --port {com} --baud 460800 write_flash 0x0 \"{indexPath}/build/MixGo_CC-0x0-V1.19.1.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
"micropython:esp32c3:mixgo_me": {
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud 460800 erase_flash && \"{esptool}\" --chip esp32c3 --port {com} --baud 460800 write_flash 0x0 \"{indexPath}/build/MixGo_ME-0x0-V1.19.1.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
"micropython:esp32c3:mixgocar_c3": {
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud 460800 erase_flash && \"{esptool}\" --chip esp32c3 --port {com} --baud 460800 write_flash 0x0 \"{indexPath}/build/MixGo_Car-0x0-V1.19.1.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
"micropython:esp32c3:generic": {
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud 460800 erase_flash && \"{esptool}\" --chip esp32c3 --port {com} --baud 460800 write_flash 0x0 \"{indexPath}/build/Generic_C3_UART-0x0-V1.19.1.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": true,
"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": false,
"dtr": true
},
"lib": {
"mixly": {
"url": [
"http://download.mixlylibs.cloud/mixly-packages/cloud-libs/micropython_esp32c3/libs.json"
]
}
},
"pythonToBlockly": false,
"web": {
"com": "serial",
"burn": {
"erase": true,
"micropython:esp32c3:mixgo_cc": {
"binFile": [
{
"offset": "0x0000",
"path": "./build/MixGo_CC-0x0-V1.19.1-lib.bin"
}, {
"offset": "0x3A0000",
"path": "../micropython/build/HZK12.bin"
}
]
},
"micropython:esp32c3:mixgo_me": {
"binFile": [
{
"offset": "0x0000",
"path": "./build/MixGo_ME-0x0-V1.19.1-lib.bin"
}, {
"offset": "0x3A0000",
"path": "../micropython/build/HZK12.bin"
}
]
},
"micropython:esp32c3:mixgocar_c3": {
"binFile": [
{
"offset": "0x0000",
"path": "./build/MixGo_Car-0x0-V1.19.1-lib.bin"
}, {
"offset": "0x3A0000",
"path": "../micropython/build/HZK12.bin"
}
]
},
"micropython:esp32c3:generic": {
"binFile": [
{
"offset": "0x0000",
"path": "./build/Generic_C3_UART-0x0-V1.19.1-lib.bin"
}, {
"offset": "0x3A0000",
"path": "../micropython/build/HZK12.bin"
}
]
}
},
"upload": {
"reset": []
}
}
}

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="controls_whileUntil" id="u{,I-BKh7cV5XWpVcxh?" x="-1001" y="-592"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="0.N;3f(m;25|SMY?G:RZ"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="display_show_image" id="|_y_}Z.LZ70V0WBG5|sT"><value name="data"><shadow type="pins_builtinimg" id="vXRb{[KMIe$[?`.7}Rr["><field name="PIN">onboard_matrix.HEART</field></shadow></value><next><block type="display_scroll_string" id="pVf*5{V.Dwe8B8PL[1S4"><value name="data"><shadow type="text" id="X.J`=QO4dA}St`CRXi1r"><field name="TEXT">你好,米思齐!</field></shadow></value></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9tYXRyaXgKCgp3aGlsZSBUcnVlOgogICAgb25ib2FyZF9tYXRyaXguc2hvd3Mob25ib2FyZF9tYXRyaXguSEVBUlQpCiAgICBvbmJvYXJkX21hdHJpeC5zY3JvbGwoJ+S9oOWlve+8jOexs+aAnem9kO+8gScpCg==</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="controls_whileUntil" id="(~F)i8]|XbxkN$1h;tnO" x="-1330" y="-796"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="HN]^a_weuVsd8t(h20v("><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="display_show_image" id="?:tuc3),vzS+`lXR)MJb"><value name="data"><shadow type="pins_builtinimg" id="y2]DPAm9P!KFo~)=+#;="><field name="PIN">onboard_matrix.HEART</field></shadow><block type="image_invert" id="LY_s@drIkQ]35/eg-8KL"><value name="A"><shadow type="pins_builtinimg" id="NgYZ7,E.N-F_5}R#`?bi"><field name="PIN">onboard_matrix.HEART</field></shadow></value></block></value><next><block type="display_scroll_string_delay" id="b9:X00KVY-@MACZ{C.El"><value name="data"><shadow type="text" id="HYM/$npd:[LKUUI#Xisd"><field name="TEXT">你好,米思齐!</field></shadow></value><value name="space"><shadow type="math_number" id="^v{xHYU/B[|ku{Bz5P1a"><field name="NUM">0</field></shadow></value><value name="time"><shadow type="math_number" id="XE+c/]Uia0+R}yHr-lE$"><field name="NUM">50</field></shadow></value></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9tYXRyaXgKCgp3aGlsZSBUcnVlOgogICAgb25ib2FyZF9tYXRyaXguc2hvd3Mob25ib2FyZF9tYXRyaXgubWFwX2ludmVydChvbmJvYXJkX21hdHJpeC5IRUFSVCkpCiAgICBvbmJvYXJkX21hdHJpeC5zY3JvbGwoJ+S9oOWlve+8jOexs+aAnem9kO+8gScsc3BlZWQgPTUwLHNwYWNlID0gMCkK</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="controls_whileUntil" id="o[nH3xp-l-uk$T-NJyhK" x="-851" y="-584"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="5at4+,D[gYTuwgrwr^Td"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="display_show_image" id="?G94[L={w+iZopF_q/hZ"><value name="data"><shadow type="pins_builtinimg" id="(m(`UriTbn871sGMFcSA"><field name="PIN">onboard_matrix.HEART</field></shadow></value><next><block type="controls_delay_new" id="@L_97Rp;`=[m|)h#;bX*"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="s3HgWUNP8i8m)4:4ulhb"><field name="NUM">0.1</field></shadow></value><next><block type="display_show_image" id=";u9l}^e}NdMtftuGcKlj"><value name="data"><shadow type="pins_builtinimg" id="$[KE@4UOQ^E4(IezwySL"><field name="PIN">onboard_matrix.HEART_SMALL</field></shadow></value><next><block type="controls_delay_new" id="TN:d3c*i3b*UJD$9fA6W"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="=aD/tD?0Yh4qlaANKHW/"><field name="NUM">0.1</field></shadow></value></block></next></block></next></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9tYXRyaXgKaW1wb3J0IHRpbWUKCgp3aGlsZSBUcnVlOgogICAgb25ib2FyZF9tYXRyaXguc2hvd3Mob25ib2FyZF9tYXRyaXguSEVBUlQpCiAgICB0aW1lLnNsZWVwKDAuMSkKICAgIG9uYm9hcmRfbWF0cml4LnNob3dzKG9uYm9hcmRfbWF0cml4LkhFQVJUX1NNQUxMKQogICAgdGltZS5zbGVlcCgwLjEpCg==</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="display_scroll_string" id="VmS)iG{FP{_W)WG[n:~m" x="-847" y="-630"><value name="data"><shadow type="text" id="Uxucq})9D6NRmBIv^M]n"><field name="TEXT">你好,米思齐!</field></shadow></value><next><block type="controls_whileUntil" id="OR$hUff?N}+oT@:jueDc"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="}?FlX-AUYM;~@mbrnCRk"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="display_show_image" id="MdngU:B2v+}8HS:}KsaC"><value name="data"><shadow type="pins_builtinimg" id="aA2g,t.bNg){=sdc2(@|"><field name="PIN">onboard_matrix.HEART</field></shadow></value><next><block type="controls_delay_new" id="fz}_3.bKPFu$q[|@L86w"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="TliyXEYNq1$55*nuS/Ow"><field name="NUM">0.1</field></shadow></value><next><block type="display_show_image" id="/2Ox)4aqWkbkTyYQm3)-"><value name="data"><shadow type="pins_builtinimg" id="va1saKx*99HI8-$jIoyE"><field name="PIN">onboard_matrix.HEART_SMALL</field></shadow></value><next><block type="controls_delay_new" id="+fdTIRtv|^uvo2`YH8=}"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="7v8.H3W31fUJ2[H/.@uU"><field name="NUM">0.1</field></shadow></value></block></next></block></next></block></next></block></statement></block></next></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9tYXRyaXgKaW1wb3J0IHRpbWUKCgpvbmJvYXJkX21hdHJpeC5zY3JvbGwoJ+S9oOWlve+8jOexs+aAnem9kO+8gScpCndoaWxlIFRydWU6CiAgICBvbmJvYXJkX21hdHJpeC5zaG93cyhvbmJvYXJkX21hdHJpeC5IRUFSVCkKICAgIHRpbWUuc2xlZXAoMC4xKQogICAgb25ib2FyZF9tYXRyaXguc2hvd3Mob25ib2FyZF9tYXRyaXguSEVBUlRfU01BTEwpCiAgICB0aW1lLnNsZWVwKDAuMSkK</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="controls_whileUntil" id=":sr2*a:6e.rY6oYtSos}" x="-1017" y="-593"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="AOxD~`!)}!4_-7;HTPs,"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="oPS@~QaIX|oN87(]2jIK"><mutation else="1"></mutation><value name="IF0"><block type="sensor_mixgo_button_is_pressed" id="WTh/*{pZ2F#^_cj_G)A{"><value name="btn"><shadow type="pins_button" id="t7h#xK[x@^gE?7Df,@@Q"><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO0"><block type="display_show_image" id="mbnQU]i2P6/1w,TthOr#"><value name="data"><shadow type="pins_builtinimg" id="9;)@$Z4@seJy?*FeGQMD"><field name="PIN">onboard_matrix.HEART</field></shadow></value></block></statement><statement name="ELSE"><block type="display_show_image" id="JFxIQJw5[0th@U![HtB1"><value name="data"><shadow type="pins_builtinimg" id="uuvNLdR:DUD1CR6v1`^e"><field name="PIN">onboard_matrix.HEART_SMALL</field></shadow></value></block></statement></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1peGdvX2NjCmZyb20gbWl4Z29fY2MgaW1wb3J0IG9uYm9hcmRfbWF0cml4CgoKd2hpbGUgVHJ1ZToKICAgIGlmIG1peGdvX2NjLkIxa2V5LmlzX3ByZXNzZWQoKToKICAgICAgICBvbmJvYXJkX21hdHJpeC5zaG93cyhvbmJvYXJkX21hdHJpeC5IRUFSVCkKICAgIGVsc2U6CiAgICAgICAgb25ib2FyZF9tYXRyaXguc2hvd3Mob25ib2FyZF9tYXRyaXguSEVBUlRfU01BTEwpCg==</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="controls_whileUntil" id="!38~y9.;1S-=cZ3tY`^B" x="-1059" y="-724"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="a]^Fj{PNBz6wK,2VF.rT"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="Fev^OZpe^_CLpc3Xs/,a"><mutation elseif="2" else="1"></mutation><value name="IF0"><block type="logic_operation" id="^Fm`pZrDRAmMi`;HWWY4"><field name="OP">AND</field><value name="A"><block type="sensor_mixgo_button_is_pressed" id=";)Nd~5KLMFgLnw#O8fW;"><value name="btn"><shadow type="pins_button" id="nu+RsfldwKY5ow6;#o}e"><field name="PIN">B1key</field></shadow></value></block></value><value name="B"><block type="sensor_mixgo_button_is_pressed" id="#(7ZvPVgGJN.z*oOW:KW"><value name="btn"><shadow type="pins_button" id="e1srs/Q49p=DOmW`gAXU"><field name="PIN">B2key</field></shadow></value></block></value></block></value><statement name="DO0"><block type="display_show_image" id="CGBdJTn=J)k(u([,k;pM"><value name="data"><shadow type="pins_builtinimg" id="Ks2;!a-oL/HiHK-AI,Mu"><field name="PIN">onboard_matrix.SAD</field></shadow></value></block></statement><value name="IF1"><block type="sensor_mixgo_button_is_pressed" id="AY07Q12P]OEX^Y#978t,"><value name="btn"><shadow type="pins_button" id="N:.VTMAame3IQ8hLs/yW"><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO1"><block type="display_show_image" id="Q=7EYyU*+YA0h?-`R*/8"><value name="data"><shadow type="pins_builtinimg" id="lEcmVmV2b}M}bX=`.iZb"><field name="PIN">onboard_matrix.HEART</field></shadow></value></block></statement><value name="IF2"><block type="sensor_mixgo_button_is_pressed" id="y@Gpv6*F~0/L$2`]oVk,"><value name="btn"><shadow type="pins_button" id="J[lVCBP~^qnx0s`LAjfH"><field name="PIN">B2key</field></shadow></value></block></value><statement name="DO2"><block type="display_show_image" id="UMv:]!=`.XU]|A:{d!U#"><value name="data"><shadow type="pins_builtinimg" id="*Y8#q1K|Jr+9z{RcEcgR"><field name="PIN">onboard_matrix.HEART_SMALL</field></shadow></value></block></statement><statement name="ELSE"><block type="display_show_image" id="7a[eD7+#KFb,5vH]I2y7"><value name="data"><shadow type="pins_builtinimg" id="ji65V=H#hHf$/{kH#(2O"><field name="PIN">onboard_matrix.SMILE</field></shadow></value></block></statement></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1peGdvX2NjCmZyb20gbWl4Z29fY2MgaW1wb3J0IG9uYm9hcmRfbWF0cml4CgoKd2hpbGUgVHJ1ZToKICAgIGlmIG1peGdvX2NjLkIxa2V5LmlzX3ByZXNzZWQoKSBhbmQgbWl4Z29fY2MuQjJrZXkuaXNfcHJlc3NlZCgpOgogICAgICAgIG9uYm9hcmRfbWF0cml4LnNob3dzKG9uYm9hcmRfbWF0cml4LlNBRCkKICAgIGVsaWYgbWl4Z29fY2MuQjFrZXkuaXNfcHJlc3NlZCgpOgogICAgICAgIG9uYm9hcmRfbWF0cml4LnNob3dzKG9uYm9hcmRfbWF0cml4LkhFQVJUKQogICAgZWxpZiBtaXhnb19jYy5CMmtleS5pc19wcmVzc2VkKCk6CiAgICAgICAgb25ib2FyZF9tYXRyaXguc2hvd3Mob25ib2FyZF9tYXRyaXguSEVBUlRfU01BTEwpCiAgICBlbHNlOgogICAgICAgIG9uYm9hcmRfbWF0cml4LnNob3dzKG9uYm9hcmRfbWF0cml4LlNNSUxFKQo=</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="controls_whileUntil" id="fdzgfY]sB6mumLo|s|P:" x="-1059" y="-724"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="DP1,h)V7S*wx?p*gcC0#"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_forEach" id="IQi7w|~fa81Yz:.n[tRI"><value name="LIST"><shadow type="list_many_input" id="#Y(e+qeE8FiN[R_$(u|/"><field name="CONTENT">0,1,2,3</field></shadow><block type="controls_range" id="uxoi9Wcjhrke_|rS,bdK"><value name="FROM"><shadow type="math_number" id="{KUGIE*W0?~BIO{T[._3"><field name="NUM">0</field></shadow></value><value name="TO"><shadow type="math_number" id="!XKX}=a-?c6|B?ne!*s1"><field name="NUM">4</field></shadow></value><value name="STEP"><shadow type="math_number" id="Dq8_)iM*IfO9YcY4F*2X"><field name="NUM">1</field></shadow></value></block></value><value name="VAR"><shadow type="variables_get" id="?4gwkXDL7vZ-$M?ReR`7"><field name="VAR">i</field></shadow></value><statement name="DO"><block type="actuator_onboard_neopixel_rgb" id=":l6Bb:dOrsp.]Ea;.)gA"><value name="_LED_"><shadow type="math_number" id="r`{/kKdxc~?T@!W`EA#)"><field name="NUM">0</field></shadow><block type="variables_get" id="N/KHaTx1PDTQOtR,Y}SS"><field name="VAR">i</field></block></value><value name="RVALUE"><shadow type="math_number" id="3j*BAEf#1^})_xaARfE3"><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="bfk/?K];uagzh`v.T^M6"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="dnw*T:wske{gF9h=V{YW"><field name="NUM">25</field></shadow></value><next><block type="actuator_onboard_neopixel_write" id=";Xw]3LkNILo.z2+9V8jQ"><next><block type="controls_delay_new" id="Rb|:0+bx{+MN=x.**vln"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="Y/JRenhnNH^.y4o()=t2"><field name="NUM">0.5</field></shadow></value></block></next></block></next></block></statement><next><block type="actuator_onboard_neopixel_rgb_all" id="~GPQP*Tc~s{veJp27)?S"><value name="RVALUE"><shadow type="math_number" id="fEADfrs:N:9h(~*etVu1"><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="[,}1WBGQ5kS=gAYC-/yO"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="~P?R5Y2aKKtR5D+/=;gY"><field name="NUM">0</field></shadow></value><next><block type="actuator_onboard_neopixel_write" id="nK#OXzV|(M6yp#dbplJg"><next><block type="controls_delay_new" id="8zU:ZuYp0y#XgjRPj$uG"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id=".@Zup)9$}(n)n,+Q!I3q"><field name="NUM">1</field></shadow></value></block></next></block></next></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9yZ2IKaW1wb3J0IHRpbWUKCgp3aGlsZSBUcnVlOgogICAgZm9yIGkgaW4gcmFuZ2UoMCwgNCwgMSk6CiAgICAgICAgb25ib2FyZF9yZ2JbaV0gPSAoMCwgMCwgMjUpCiAgICAgICAgb25ib2FyZF9yZ2Iud3JpdGUoKQogICAgICAgIHRpbWUuc2xlZXAoMC41KQogICAgb25ib2FyZF9yZ2IuZmlsbCgoMCwgMCwgMCkpCiAgICBvbmJvYXJkX3JnYi53cml0ZSgpCiAgICB0aW1lLnNsZWVwKDEpCg==</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="controls_whileUntil" id="VHFLfgj7F]AJlOZT631w" x="-1059" y="-724"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="9X`HxHaw(qeeLgVh_zd."><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_forEach" id="+??Lt3ISBLh#n_M$Sd99"><value name="LIST"><shadow type="list_many_input" id="kZVNJ6qtq2uE0`]6$MI^"><field name="CONTENT">0,1,2,3</field></shadow><block type="controls_range" id=")@/#AGX[/5j_?gbAQCbo"><value name="FROM"><shadow type="math_number" id="/NU-ek9/Y;3hi|/B]Snq"><field name="NUM">0</field></shadow></value><value name="TO"><shadow type="math_number" id="3D,LV1E??p[zPJt1CtOi"><field name="NUM">4</field></shadow></value><value name="STEP"><shadow type="math_number" id="XdI,KV`zYDd6z9oLv;lE"><field name="NUM">1</field></shadow></value></block></value><value name="VAR"><shadow type="variables_get" id="gCzb+U#t]/`q7B[k2u(]"><field name="VAR">i</field></shadow></value><statement name="DO"><block type="actuator_onboard_neopixel_rgb_all" id="O_i[E7F_pa~iixHThanv"><value name="RVALUE"><shadow type="math_number" id="227,gTX1r)z|y:9$Zci:"><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="B;hq[rIv/aOVv-Z:|/qM"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="5I637**t0+.X=OlWH61P"><field name="NUM">0</field></shadow></value><next><block type="actuator_onboard_neopixel_rgb" id="_X8O0~|*K!WNWOG;=*HN"><value name="_LED_"><shadow type="math_number" id="i};dd4,iO@u-0I{H{W2u"><field name="NUM">0</field></shadow><block type="variables_get" id="#8TYObYCvKwfEZg+!IV#"><field name="VAR">i</field></block></value><value name="RVALUE"><shadow type="math_number" id=",HhvDkVQ7tF)ZOh=n?Z;"><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="/7#P}9(Wffox^iiVpRnV"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="IA@NKpQrbq`mk-vCO9z="><field name="NUM">25</field></shadow></value><next><block type="actuator_onboard_neopixel_write" id="(8cA:Jh[x$Y5szvAQpz["><next><block type="controls_delay_new" id="65*V:tN@];*INtz);h-H"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="v{pM2hkC2,Nqz/MCR3A="><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="0Z7XesjU:f$*/D9Ew2fS"><value name="RVALUE"><shadow type="math_number" id="}jIkVoR|qZg}`(SPuuuJ"><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="gX1g_W`-#L7J_r+1L7W,"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="cC:,c8]z:*70!$(Kt:T;"><field name="NUM">0</field></shadow></value><next><block type="actuator_onboard_neopixel_write" id="eB*8+.(aOja^0m.o6?1^"><next><block type="controls_delay_new" id="YebnIcA$KLYNgdlsv6:w"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="0!ryr0;@jvecgsV]D]6g"><field name="NUM">1</field></shadow></value></block></next></block></next></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9yZ2IKaW1wb3J0IHRpbWUKCgp3aGlsZSBUcnVlOgogICAgZm9yIGkgaW4gcmFuZ2UoMCwgNCwgMSk6CiAgICAgICAgb25ib2FyZF9yZ2IuZmlsbCgoMCwgMCwgMCkpCiAgICAgICAgb25ib2FyZF9yZ2JbaV0gPSAoMCwgMCwgMjUpCiAgICAgICAgb25ib2FyZF9yZ2Iud3JpdGUoKQogICAgICAgIHRpbWUuc2xlZXAoMC41KQogICAgb25ib2FyZF9yZ2IuZmlsbCgoMCwgMCwgMCkpCiAgICBvbmJvYXJkX3JnYi53cml0ZSgpCiAgICB0aW1lLnNsZWVwKDEpCg==</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="controls_whileUntil" id="ppnLV;1Tsqn/?uog!Ylv" x="-1059" y="-724"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="7xyT$z:RL#R!GabvBPP?"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="RuOG$ddBja/Ft(eX{QNs"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="`j)8{Ge,WcTs/uF7+Qau"><value name="btn"><shadow type="pins_button" id="Hq)iU_6$J;gEK$qSaZMX"><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO0"><block type="display_show_image" id="l0EA|Ta;ti)p98:K#Vw0"><value name="data"><shadow type="pins_builtinimg" id="EPb@Iq{/==l+)F,8,*Yq"><field name="PIN">onboard_matrix.HEART</field></shadow></value></block></statement><next><block type="controls_if" id="UZ]48(zIZg`-h8MKkL}+"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="-wKAwe:|KhcrsrFWptuN"><value name="btn"><shadow type="pins_button" id="gOv*Hx6RyPIYBlDgoume"><field name="PIN">B2key</field></shadow></value></block></value><statement name="DO0"><block type="display_clear" id="6K+]W5;vL0or6r$:a}/("></block></statement></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1peGdvX2NjCmZyb20gbWl4Z29fY2MgaW1wb3J0IG9uYm9hcmRfbWF0cml4CgoKd2hpbGUgVHJ1ZToKICAgIGlmIG1peGdvX2NjLkIxa2V5Lndhc19wcmVzc2VkKCk6CiAgICAgICAgb25ib2FyZF9tYXRyaXguc2hvd3Mob25ib2FyZF9tYXRyaXguSEVBUlQpCiAgICBpZiBtaXhnb19jYy5CMmtleS53YXNfcHJlc3NlZCgpOgogICAgICAgIG9uYm9hcmRfbWF0cml4LmZpbGwoMCkKICAgICAgICBvbmJvYXJkX21hdHJpeC5zaG93KCkK</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="controls_whileUntil" id="pus+)B;~v3rwsO[1k]Km" x="-1437" y="-624"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="@+S[];!BWn:E2]B7:l5H"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="^.JG1I^zrAI/JS=uhj:#"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="||LtiK)Kq_ApCdtOgd,-"><value name="btn"><shadow type="pins_button" id="U(vGD,lvMV?ZT8iNsTh$"><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO0"><block type="do_while" id="ez]04Sm^dv3R!50`?A!8"><field name="type">true</field><statement name="input_data"><block type="display_show_image" id="~K9c(XXU!qB`.MMppZ|H"><value name="data"><shadow type="pins_builtinimg" id="k`1Yn=Yze/18_pFSOs@1"><field name="PIN">onboard_matrix.HEART</field></shadow></value></block></statement><value name="select_data"><block type="sensor_mixgo_button_was_pressed" id="HyV2PY3RHpHWIBW87Uyp"><value name="btn"><shadow type="pins_button" id="Nfzwd:-?LX?!9AT{TJ_8"><field name="PIN">B1key</field></shadow></value></block></value><next><block type="display_clear" id=",H25+^ON:/:/-v|T9{(,"></block></next></block></statement></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1peGdvX2NjCmZyb20gbWl4Z29fY2MgaW1wb3J0IG9uYm9hcmRfbWF0cml4CgoKd2hpbGUgVHJ1ZToKICAgIGlmIG1peGdvX2NjLkIxa2V5Lndhc19wcmVzc2VkKCk6CiAgICAgICAgd2hpbGUgVHJ1ZToKICAgICAgICAgICAgb25ib2FyZF9tYXRyaXguc2hvd3Mob25ib2FyZF9tYXRyaXguSEVBUlQpCiAgICAgICAgICAgIGlmIChtaXhnb19jYy5CMWtleS53YXNfcHJlc3NlZCgpKToKICAgICAgICAgICAgICAgIGJyZWFrCiAgICAgICAgb25ib2FyZF9tYXRyaXguZmlsbCgwKQogICAgICAgIG9uYm9hcmRfbWF0cml4LnNob3coKQo=</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="variables_set" id="D5Hq7e4m2J!pdqao!L~9" x="-1054" y="-758"><field name="VAR">显示</field><value name="VALUE"><block type="logic_boolean" id="Zh`b6MIMaxVlEJ40-!EY"><field name="BOOL">FALSE</field></block></value><next><block type="controls_whileUntil" id="h:v?zh,Z`3wWO{0FW:-e"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="L6Ejt5!VC69M_hbA:j-s"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="^Sz`CJ^6fInslNWr(qeI"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="xfyyYWw,pNvCDX*TP2Ym"><value name="btn"><shadow type="pins_button" id="_DY]^,kOJpHHhd6Yd;LU"><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO0"><block type="variables_set" id="lp.wB$I2:;eBNUlG|6/w"><field name="VAR">显示</field><value name="VALUE"><block type="logic_negate" id=".0`T[,@CARy2K?]G/?N;"><value name="BOOL"><block type="variables_get" id="7emej_Sa=zPT?Z3K##-M"><field name="VAR">显示</field></block></value></block></value></block></statement><next><block type="controls_if" id="0m6I?4}(XtZIf3s0;O-h"><mutation else="1"></mutation><value name="IF0"><block type="variables_get" id="Mmds*z^JDV8o$h/3M;=h"><field name="VAR">显示</field></block></value><statement name="DO0"><block type="display_show_image" id="5PewTZZc|Liu2|Ni!OKV"><value name="data"><shadow type="pins_builtinimg" id="n.P4PGbWIb_mmk[XlWnK"><field name="PIN">onboard_matrix.HEART</field></shadow></value></block></statement><statement name="ELSE"><block type="display_clear" id="oj+i`U-h]_y(/ZnV1Dzg"></block></statement></block></next></block></statement></block></next></block></xml><config>{}</config><code>aW1wb3J0IG1peGdvX2NjCmZyb20gbWl4Z29fY2MgaW1wb3J0IG9uYm9hcmRfbWF0cml4CgoKX0U2Xzk4X0JFX0U3X0E0X0JBID0gRmFsc2UKd2hpbGUgVHJ1ZToKICAgIGlmIG1peGdvX2NjLkIxa2V5Lndhc19wcmVzc2VkKCk6CiAgICAgICAgX0U2Xzk4X0JFX0U3X0E0X0JBID0gbm90IF9FNl85OF9CRV9FN19BNF9CQQogICAgaWYgX0U2Xzk4X0JFX0U3X0E0X0JBOgogICAgICAgIG9uYm9hcmRfbWF0cml4LnNob3dzKG9uYm9hcmRfbWF0cml4LkhFQVJUKQogICAgZWxzZToKICAgICAgICBvbmJvYXJkX21hdHJpeC5maWxsKDApCiAgICAgICAgb25ib2FyZF9tYXRyaXguc2hvdygpCg==</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="controls_whileUntil" id="i=J}Wu{YfW@W6VH$Y?!X" x="-1444" y="-789"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="{WxlIfCx@d:`BEDFN6J]"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="system_print" id="[J~^6K0-|jO~S4pH!F~9"><value name="VAR"><shadow type="text" id="z:ct5J2)VYra/+]N~*r1"><field name="TEXT">Mixly</field></shadow><block type="sensor_sound" id="O_mztL$cGGA5Rt;~Rl5G"></block></value><next><block type="controls_delay_new" id="?}h]T?U#+Xc/:]o-)${1"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id=";Os]j[Yg@NW~/n;mAA+p"><field name="NUM">0.01</field></shadow></value></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1hY2hpbmUKZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9zb3VuZAppbXBvcnQgdGltZQoKCndoaWxlIFRydWU6CiAgICBwcmludChvbmJvYXJkX3NvdW5kLnJlYWQoKSkKICAgIHRpbWUuc2xlZXAoMC4wMSkK</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="controls_whileUntil" id="m62m_/5*iCEJ~]Cv(2K}" x="-1457" y="-799"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="Zl7($Ts`/O.ba1o)wU9C"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="system_print" id="KvD+!lSuAiW7;mAKGygJ"><value name="VAR"><shadow type="text" id="w~9du*w*#AIq.V2[!imT"><field name="TEXT">Mixly</field></shadow><block type="sensor_sound" id="xcUI.+A,!K-h#]WZT=52"></block></value><next><block type="controls_forEach" id="z-b8b@lu~FcG!YrTam/1"><value name="LIST"><shadow type="list_many_input" id="hp^4.}i2i4B0*[IZ]Pe]"><field name="CONTENT">0,1,2,3</field></shadow><block type="controls_range" id="LFGi/i[]:YPL6Oavy(FD"><value name="FROM"><shadow type="math_number" id="8`T-JpcJUYd5|+E/p4ks"><field name="NUM">0</field></shadow></value><value name="TO"><shadow type="math_number" id="!DjuX,*T^7XQ{P`hQ(mf"><field name="NUM">5</field></shadow><block type="text_to_number" id="XRxIq_y.S(+gZZB7~bWX"><field name="TOWHAT">int</field><value name="VAR"><shadow type="variables_get" id="tfd6^BTmh:Ds7nTnmTT{"><field name="VAR">x</field></shadow><block type="math_map" id="cp7:+[RXZUV2H(+UcV$g"><value name="NUM"><shadow type="math_number" id="f`x4C4=Ef@Qx~(N{kX]:"><field name="NUM">50</field></shadow><block type="sensor_sound" id="0w/H:OB)X1)XjOJMtxq;"></block></value><value name="fromLow"><shadow type="math_number" id="f|_bOwxqBuN]hIV|k#D1"><field name="NUM">0</field></shadow></value><value name="fromHigh"><shadow type="math_number" id="d;rECHC6RSN{diPG`QPq"><field name="NUM">30000</field></shadow></value><value name="toLow"><shadow type="math_number" id="O}9r9yJyqfGTy.8JoQ8Y"><field name="NUM">0</field></shadow></value><value name="toHigh"><shadow type="math_number" id="xhBk,kS!o@Nvk_q}/ZV#"><field name="NUM">11</field></shadow></value></block></value></block></value><value name="STEP"><shadow type="math_number" id="[4)u=Xr.k$U_Z@Aesb{q"><field name="NUM">1</field></shadow></value></block></value><value name="VAR"><shadow type="variables_get" id=")5{Pw)1JV;mtx|hfS3RE"><field name="VAR">y</field></shadow></value><statement name="DO"><block type="display_bright_point" id="ms2)kFs]yGJIF#{F=InM"><value name="x"><shadow type="pins_exlcdh" id="746iBE[hsmO9^)zxUuF."><field name="PIN">31</field></shadow></value><value name="y"><shadow type="pins_exlcdv" id="hcN|Kn4qw3DrZT:~Jc5!"><field name="PIN">0</field></shadow><block type="math_arithmetic" id="GD6T9}moRtJ2JLBk/c??"><field name="OP">MINUS</field><value name="A"><shadow type="math_number" id="_R95n`78ZAYsXOpGi|WI"><field name="NUM">11</field></shadow></value><value name="B"><shadow type="math_number" id="KT[Uyt)+]Xp^,`QJq^}6"><field name="NUM">1</field></shadow><block type="variables_get" id="2lF7Xq:G!)L;{JQ89aLT"><field name="VAR">y</field></block></value></block></value><value name="STAT"><shadow type="display_onoff" id="=?#gxq{|tdccyB;UuM8x"><field name="ONOFF">ON</field></shadow></value></block></statement><next><block type="display_shift" id="X@tWj*Hn#W3kn,lHtqIa"><field name="OP">shift_left</field><value name="val"><shadow type="math_number" id="nmRt`vV1vUXO*Z{._^v?"><field name="NUM">1</field></shadow></value><next><block type="controls_delay_new" id="3tAMl!OCU@=2M/kmcdSX"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="0b9^5~#7_[Py_#Sn30kA"><field name="NUM">0.05</field></shadow></value></block></next></block></next></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1hY2hpbmUKZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9zb3VuZApmcm9tIG1peHB5IGltcG9ydCBtYXRoX21hcApmcm9tIG1peGdvX2NjIGltcG9ydCBvbmJvYXJkX21hdHJpeAppbXBvcnQgdGltZQoKCndoaWxlIFRydWU6CiAgICBwcmludChvbmJvYXJkX3NvdW5kLnJlYWQoKSkKICAgIGZvciB5IGluIHJhbmdlKDAsIGludCgobWF0aF9tYXAob25ib2FyZF9zb3VuZC5yZWFkKCksIDAsIDMwMDAwLCAwLCAxMSkpKSwgMSk6CiAgICAgICAgb25ib2FyZF9tYXRyaXgucGl4ZWwoaW50KDMxKSwgaW50KDExIC0geSksIDEpCiAgICAgICAgb25ib2FyZF9tYXRyaXguc2hvdygpCiAgICBvbmJvYXJkX21hdHJpeC5zaGlmdF9sZWZ0KDEpCiAgICB0aW1lLnNsZWVwKDAuMDUpCg==</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="controls_whileUntil" id="gC{.RJ0YB+2@-`Y79,J9" x="-1433" y="-745"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="Z0qU]:T:6(!KNSOGe:c:"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="system_print" id="_38I3coV6oFh#N6,TNTx"><value name="VAR"><shadow type="text" id="ZnY0/#1m{M/OuKEZ/mS_"><field name="TEXT">Mixly</field></shadow><block type="sensor_LTR308" id="@h{,u[Ho:U-p}^vi-E-S"></block></value><next><block type="display_show_image_or_string_delay" id="nFPidh;5HH1.hLnD`U#i"><field name="center">False</field><value name="data"><shadow type="text" id=";ljvN!eWQ_H1Ay75[3+i"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="CA^i,B.;hGUR@Z{5-Q!="><value name="VAR"><shadow type="variables_get" id="Wc!80GU^YY6au#n.)`V0"><field name="VAR">x</field></shadow><block type="text_to_number" id="gCehjvwwR93}2bXn6+wz"><field name="TOWHAT">int</field><value name="VAR"><shadow type="variables_get" id="t)x,XEhP7Oyu5Vhr]`*z"><field name="VAR">x</field></shadow><block type="sensor_LTR308" id="h*dj3]e5x9-Kc$g.k0J}"></block></value></block></value></block></value><value name="space"><shadow type="math_number" id="Qx,C{++2bK]pU|5/_7}d"><field name="NUM">0</field></shadow></value><next><block type="controls_delay_new" id="dwJmWe`!3w,g=bPQcvb6"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="R*L0V)S8]N6mP1zvzz(D"><field name="NUM">0.1</field></shadow></value></block></next></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1hY2hpbmUKZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9hbHMKZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9tYXRyaXgKaW1wb3J0IHRpbWUKCgp3aGlsZSBUcnVlOgogICAgcHJpbnQob25ib2FyZF9hbHMuYWxzX3ZpcygpKQogICAgb25ib2FyZF9tYXRyaXguc2hvd3Moc3RyKGludChvbmJvYXJkX2Fscy5hbHNfdmlzKCkpKSxzcGFjZSA9IDAsY2VudGVyID0gRmFsc2UpCiAgICB0aW1lLnNsZWVwKDAuMSkK</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-C3@MixGo CC"><block type="variables_set" id="8t$_^8OjUv^d*YZ9E(JG" x="-1439" y="-816"><field name="VAR">接近距离</field><value name="VALUE"><block type="math_number" id="=t$?gd6/MA,xrA.Y+~vc"><field name="NUM">0</field></block></value><next><block type="controls_whileUntil" id="9Njji^zv$.xSTW^jk]8m"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="P!FHTQv]bIivJ.mJR1L`"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="variables_set" id="Ox4,W!Ry0;/cD$hX]i7g"><field name="VAR">接近距离</field><value name="VALUE"><block type="text_to_number" id="^Ob`@Rbj[:(z^#vz(]oU"><field name="TOWHAT">int</field><value name="VAR"><shadow type="variables_get" id="]J(L4Lc-;tH][73Fit$="><field name="VAR">x</field></shadow><block type="sensor_mixgo_pin_near_single" id="w=,_QtbA$gy{Hz=Nm:6D"></block></value></block></value><next><block type="system_print" id="1]:lC1;ipN`LJUII99Me"><value name="VAR"><shadow type="text" id="z`Rh_~:)5uf^!c9Y_J;D"><field name="TEXT">Mixly</field></shadow><block type="variables_get" id="7G;1X.^YmLQSE`RW-X8k"><field name="VAR">接近距离</field></block></value><next><block type="display_scroll_string" id="iX,4W]Ab!+a_v4YHs~g0"><value name="data"><shadow type="text" id="M=-v=+S]Nu1Oi,+ZWH)j"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="6GGY]o#=nMYh#Mc.S5t_"><value name="VAR"><shadow type="variables_get" id="Ju{^ro7k,*:)o}H#TJR4"><field name="VAR">x</field></shadow><block type="variables_get" id="VOhbN9FN6)z/Vu2^s*n0"><field name="VAR">接近距离</field></block></value></block></value></block></next></block></next></block></statement></block></next></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9hbHMKaW1wb3J0IG1hY2hpbmUKZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9tYXRyaXgKCgpfRTZfOEVfQTVfRThfQkZfOTFfRThfQjdfOURfRTdfQTZfQkIgPSAwCndoaWxlIFRydWU6CiAgICBfRTZfOEVfQTVfRThfQkZfOTFfRThfQjdfOURfRTdfQTZfQkIgPSBpbnQob25ib2FyZF9hbHMucHNfbmwoKSkKICAgIHByaW50KF9FNl84RV9BNV9FOF9CRl85MV9FOF9CN185RF9FN19BNl9CQikKICAgIG9uYm9hcmRfbWF0cml4LnNjcm9sbChzdHIoX0U2XzhFX0E1X0U4X0JGXzkxX0U4X0I3XzlEX0U3X0E2X0JCKSkK</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="variables_set" id="?oIzj=|sd,0SQ/fTktS:" x="-1439" y="-831"><field name="VAR">接近距离</field><value name="VALUE"><block type="math_number" id="C~9jgAW|{]2jbri7{c0/"><field name="NUM">0</field></block></value><next><block type="variables_set" id="Q.n@kSsqnc3,q4AkjWgL"><field name="VAR">是否报警</field><value name="VALUE"><block type="logic_boolean" id=":lch1{)yw(Wo[~^8-Y]g"><field name="BOOL">FALSE</field></block></value><next><block type="controls_whileUntil" id="2hL^NaZsaNBy^,KxxR9f"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="ALBRea6L2k{@D)9W4O0="><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="variables_set" id="0vnOH8eIFjzXd:#lY2l`"><field name="VAR">接近距离</field><value name="VALUE"><block type="text_to_number" id="+ez)GXSj0WIZDwyN_w^y"><field name="TOWHAT">int</field><value name="VAR"><shadow type="variables_get" id="gZc8^rem@eT}NtQ+ztpR"><field name="VAR">x</field></shadow><block type="sensor_mixgo_pin_near_single" id="DZG_enmga,TdE2(fYe)?"></block></value></block></value><next><block type="system_print" id="?G5U)SG_H+*TM^R}wrh4"><value name="VAR"><shadow type="text" id="nqHIHr,Q)@(I7VsmbkE?"><field name="TEXT">Mixly</field></shadow><block type="variables_get" id="+z4@YawBJ[A+IqZSl.Ab"><field name="VAR">接近距离</field></block></value><next><block type="display_show_image_or_string_delay" id="hSiH_0Eq;Q$ht13].Cgv"><field name="center">True</field><value name="data"><shadow type="text" id="_01FUd+`2j-qJ:83rce["><field name="TEXT">Mixly</field></shadow><block type="variables_get" id="mh7u6+V1rv/=ZZF:HTN{"><field name="VAR">接近距离</field></block></value><value name="space"><shadow type="math_number" id="^:t}CmXu^V;Oi*42T}/j"><field name="NUM">0</field></shadow></value><next><block type="variables_set" id="igEmEgb}VW93oiA}E.pU"><field name="VAR">是否报警</field><value name="VALUE"><block type="logic_compare" id=":*|zfA?4;tcZ}#);F=02"><field name="OP">GT</field><value name="A"><block type="variables_get" id="QfhD1/~V9#O(k$dvuqtY"><field name="VAR">接近距离</field></block></value><value name="B"><block type="math_number" id="!ui0V=!/qfrQbThe6?jd"><field name="NUM">1000</field></block></value></block></value><next><block type="controls_if" id="1[j[d!pa1bZdVo|mpr5="><value name="IF0"><block type="variables_get" id="y7$22sMF9w]pGl}n)gsC"><field name="VAR">是否报警</field></block></value><statement name="DO0"><block type="esp32_onboard_music_play_list" id="x[6zrGZ`lNPIV.Pn6xA;"><value name="LIST"><shadow type="pins_playlist" id="{_Nc(+wjkj)75xwiZ2gf"><field name="PIN">onboard_music.DADADADUM</field></shadow></value></block></statement></block></next></block></next></block></next></block></next></block></statement></block></next></block></next></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9hbHMKaW1wb3J0IG1hY2hpbmUKZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9tYXRyaXgKZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9tdXNpYwoKCl9FNl84RV9BNV9FOF9CRl85MV9FOF9CN185RF9FN19BNl9CQiA9IDAKX0U2Xzk4X0FGX0U1XzkwX0E2X0U2XzhBX0E1X0U4X0FEX0E2ID0gRmFsc2UKd2hpbGUgVHJ1ZToKICAgIF9FNl84RV9BNV9FOF9CRl85MV9FOF9CN185RF9FN19BNl9CQiA9IGludChvbmJvYXJkX2Fscy5wc19ubCgpKQogICAgcHJpbnQoX0U2XzhFX0E1X0U4X0JGXzkxX0U4X0I3XzlEX0U3X0E2X0JCKQogICAgb25ib2FyZF9tYXRyaXguc2hvd3MoX0U2XzhFX0E1X0U4X0JGXzkxX0U4X0I3XzlEX0U3X0E2X0JCLHNwYWNlID0gMCxjZW50ZXIgPSBUcnVlKQogICAgX0U2Xzk4X0FGX0U1XzkwX0E2X0U2XzhBX0E1X0U4X0FEX0E2ID0gX0U2XzhFX0E1X0U4X0JGXzkxX0U4X0I3XzlEX0U3X0E2X0JCID4gMTAwMAogICAgaWYgX0U2Xzk4X0FGX0U1XzkwX0E2X0U2XzhBX0E1X0U4X0FEX0E2OgogICAgICAgIG9uYm9hcmRfbXVzaWMucGxheShvbmJvYXJkX211c2ljLkRBREFEQURVTSkK</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="controls_whileUntil" id="iA[{R`6+YOLpnc6j*t1l" x="-1405" y="-729"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="WVB:[)h|h1!W/:}4UGXY"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="system_print" id="{C(FGQKh+8k)wrmT}bnN"><value name="VAR"><shadow type="text" id="[;~^0EZ1Q3b(N=Wk@n{_"><field name="TEXT">Mixly</field></shadow><block type="sensor_get_acceleration" id="^UdM}Hx4]oLyC$:y6N}#"><field name="key"></field></block></value><next><block type="controls_delay_new" id="Q[A8Eh)b+E1CPpqj:TL^"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="3A6U_7wbbkHytbrq.u|_"><field name="NUM">1</field></shadow></value></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1hY2hpbmUKZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9hY2MKaW1wb3J0IHRpbWUKCgp3aGlsZSBUcnVlOgogICAgcHJpbnQob25ib2FyZF9hY2MuYWNjZWxlcmF0aW9uKCkpCiAgICB0aW1lLnNsZWVwKDEpCg==</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-C3@MixGo CC"><block type="controls_whileUntil" id="Cry1n-:/)_31BMsByiq." x="-1632" y="-819"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="Wc_^t`*8$Tz04N|NZ?tl"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="display_show_image_or_string_delay" id="o.8Om$^]pbLaySx:q#mI"><field name="center">True</field><value name="data"><shadow type="text" id="1WvlkOy;zkFck]RCN;6*"><field name="TEXT">Mixly</field></shadow><block type="text_join" id="UCr5YfP`_^^Zmwfu:;|0"><value name="A"><shadow type="text" id="Cy,?~ny?+l.Drc([yI!W"><field name="TEXT">T:</field></shadow></value><value name="B"><shadow type="text" id="2K@cvEZt=pUdqXD0U{]i"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="?iocT.R,*`L,#HZBtlQ["><value name="VAR"><shadow type="variables_get" id="]LR=sedg8+M89kg3~F{0"><field name="VAR">x</field></shadow><block type="text_to_number" id="r-eOl~MxSA$3eFuP3GnX"><field name="TOWHAT">int</field><value name="VAR"><shadow type="variables_get" id="Jm~P4y29MVh[/`Fte{0}"><field name="VAR">x</field></shadow><block type="sensor_aht11" id="5^;_=bn100lo4,P??j!4"><field name="key">temperature</field></block></value></block></value></block></value></block></value><value name="space"><shadow type="math_number" id="G^q@=p#+=-BH3{M#.CUB"><field name="NUM">0</field></shadow></value><next><block type="controls_delay_new" id="kp=NncVBK6~{yH14wFHJ"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="98Y]H^ooWVwvIBVoDLqc"><field name="NUM">1</field></shadow></value><next><block type="display_show_image_or_string_delay" id="EbDT8M-{yaB.mwP#OTtM"><field name="center">True</field><value name="data"><shadow type="text" id="1WvlkOy;zkFck]RCN;6*"><field name="TEXT">Mixly</field></shadow><block type="text_join" id="!0Q(MKnB(Xd.V(zlW`lP"><value name="A"><shadow type="text" id="mw*5(qMV@f~bQlvtj-Un"><field name="TEXT">H:</field></shadow></value><value name="B"><shadow type="text" id="2K@cvEZt=pUdqXD0U{]i"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="a8gLz]4MM7uaSJ,DlNsZ"><value name="VAR"><shadow type="variables_get" id="]LR=sedg8+M89kg3~F{0"><field name="VAR">x</field></shadow><block type="text_to_number" id="i-H]f-xt[7.67b*lYhI@"><field name="TOWHAT">int</field><value name="VAR"><shadow type="variables_get" id="Jm~P4y29MVh[/`Fte{0}"><field name="VAR">x</field></shadow><block type="sensor_aht11" id="KneS)m##d~JwAq/@Xiov"><field name="key">humidity</field></block></value></block></value></block></value></block></value><value name="space"><shadow type="math_number" id="H1ccD?BM^+$z!x4YTni9"><field name="NUM">0</field></shadow></value><next><block type="controls_delay_new" id="9}Y=DsC|oN_oyGxG]_B8"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="cNU$+8ZwTe$w7:{K/AKU"><field name="NUM">1</field></shadow></value></block></next></block></next></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF90aHMKZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9tYXRyaXgKaW1wb3J0IHRpbWUKCgp3aGlsZSBUcnVlOgogICAgb25ib2FyZF9tYXRyaXguc2hvd3MoJ1Q6JyArIHN0cihpbnQob25ib2FyZF90aHMudGVtcGVyYXR1cmUoKSkpLHNwYWNlID0gMCxjZW50ZXIgPSBUcnVlKQogICAgdGltZS5zbGVlcCgxKQogICAgb25ib2FyZF9tYXRyaXguc2hvd3MoJ0g6JyArIHN0cihpbnQob25ib2FyZF90aHMuaHVtaWRpdHkoKSkpLHNwYWNlID0gMCxjZW50ZXIgPSBUcnVlKQogICAgdGltZS5zbGVlcCgxKQo=</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="controls_whileUntil" id="Cry1n-:/)_31BMsByiq." x="-1833" y="-789"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="Wc_^t`*8$Tz04N|NZ?tl"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="display_scroll_string" id="eY^com_CZyvgW,h|eii("><value name="data"><shadow type="text" id="AuWpf7)UhBi-YX]{^_94"><field name="TEXT">Mixly</field></shadow><block type="text_join" id="UCr5YfP`_^^Zmwfu:;|0"><value name="A"><shadow type="text" id="Cy,?~ny?+l.Drc([yI!W"><field name="TEXT">大气压:</field></shadow></value><value name="B"><shadow type="text" id="2K@cvEZt=pUdqXD0U{]i"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="?iocT.R,*`L,#HZBtlQ["><value name="VAR"><shadow type="variables_get" id="]LR=sedg8+M89kg3~F{0"><field name="VAR">x</field></shadow><block type="text_to_number" id="r-eOl~MxSA$3eFuP3GnX"><field name="TOWHAT">int</field><value name="VAR"><shadow type="variables_get" id="Jm~P4y29MVh[/`Fte{0}"><field name="VAR">x</field></shadow><block type="sensor_hp203" id="d`d$@|5O2d[lxLH(`PBc"><field name="key">pressure()</field></block></value></block></value></block></value></block></value><next><block type="display_scroll_string" id="+SZ{dq^t6i]3R!g;o9[s"><value name="data"><shadow type="text" id="AuWpf7)UhBi-YX]{^_94"><field name="TEXT">Mixly</field></shadow><block type="text_join" id="TQKIi/53{IMcU^GI,5J$"><value name="A"><shadow type="text" id="}P2N+yRdOy1$N$Mi-YHb"><field name="TEXT">海拔:</field></shadow></value><value name="B"><shadow type="text" id="2K@cvEZt=pUdqXD0U{]i"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="JbLy6g;^ZRPcJw/xG,Xs"><value name="VAR"><shadow type="variables_get" id="]LR=sedg8+M89kg3~F{0"><field name="VAR">x</field></shadow><block type="text_to_number" id="8m(H3b:SeXHyl~E3L(`k"><field name="TOWHAT">int</field><value name="VAR"><shadow type="variables_get" id="Jm~P4y29MVh[/`Fte{0}"><field name="VAR">x</field></shadow><block type="sensor_hp203" id="rX4P=+Zpw8;)l+Z~CdM{"><field name="key">altitude()</field></block></value></block></value></block></value></block></value><next><block type="display_scroll_string" id="{)(!WK1Lr4-;j5Yh]Bk!"><value name="data"><shadow type="text" id="AuWpf7)UhBi-YX]{^_94"><field name="TEXT">Mixly</field></shadow><block type="text_join" id="`luS]:dy{nl`[u3}(gzg"><value name="A"><shadow type="text" id="+yd=W{1++TQ_$!4MYjC`"><field name="TEXT">温度:</field></shadow></value><value name="B"><shadow type="text" id="2K@cvEZt=pUdqXD0U{]i"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="r_Sz)X0M{I[otV)}d@Nn"><value name="VAR"><shadow type="variables_get" id="]LR=sedg8+M89kg3~F{0"><field name="VAR">x</field></shadow><block type="text_to_number" id=",q}OTT6Ie^IaEHoX!IW}"><field name="TOWHAT">int</field><value name="VAR"><shadow type="variables_get" id="Jm~P4y29MVh[/`Fte{0}"><field name="VAR">x</field></shadow><block type="sensor_hp203" id="nIV(-l.(B]?zM#I?}Q=D"><field name="key">temperature()</field></block></value></block></value></block></value></block></value></block></next></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9tYXRyaXgKZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9icHMKCgp3aGlsZSBUcnVlOgogICAgb25ib2FyZF9tYXRyaXguc2Nyb2xsKCflpKfmsJTljos6JyArIHN0cihpbnQob25ib2FyZF9icHMucHJlc3N1cmUoKSkpKQogICAgb25ib2FyZF9tYXRyaXguc2Nyb2xsKCfmtbfmi5Q6JyArIHN0cihpbnQob25ib2FyZF9icHMuYWx0aXR1ZGUoKSkpKQogICAgb25ib2FyZF9tYXRyaXguc2Nyb2xsKCfmuKnluqY6JyArIHN0cihpbnQob25ib2FyZF9icHMudGVtcGVyYXR1cmUoKSkpKQo=</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-C3@MixGo CC"><block type="display_bright_point" id="*|2smm*9cQ$P.h0X,,]X" x="-675" y="-358"><value name="x"><shadow type="pins_exlcdh" id="{B7EK7hoP;*X!kuX!L=W"><field name="PIN">16</field></shadow></value><value name="y"><shadow type="pins_exlcdv" id="Qu[(^kBbHb]m[`sZqd4H"><field name="PIN">6</field></shadow></value><value name="STAT"><shadow type="display_onoff" id="7;N2`loH+y54:iF~qwAk"><field name="ONOFF">ON</field></shadow></value><next><block type="controls_whileUntil" id="$qZShSnvv#9:FB{;(I=2"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="$^7qr.^#xQ[1+HRR|OLX"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="2,t]oB`[K{A,KzoFREr8"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="yf_n){j3C6!2#:a!kkyn"><value name="btn"><shadow type="pins_button" id="5uJSJ{6,[0S^9Ag5Vpim"><field name="PIN">A1key</field></shadow></value></block></value><statement name="DO0"><block type="display_shift" id=":IU*a{hG#pP.cN$6lui3"><field name="OP">shift_down</field><value name="val"><shadow type="math_number" id="iSnv{*y6sk+z+r6vp1(_"><field name="NUM">1</field></shadow></value></block></statement><next><block type="controls_if" id="jy#wHC)B5rB2L[jpA!I:"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="+SAWMSN^Rg(0:7s6O#aH"><value name="btn"><shadow type="pins_button" id="SDQC#g*r*T7[kyJJ_i*C"><field name="PIN">A2key</field></shadow></value></block></value><statement name="DO0"><block type="display_shift" id="5V`8=Z[TfFBQJM.T)6s1"><field name="OP">shift_left</field><value name="val"><shadow type="math_number" id="EQWzGeQz:w~@S$EW0}X|"><field name="NUM">1</field></shadow></value></block></statement><next><block type="controls_if" id="xHGvO3K=wB/a=?K1;oow"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="c?~uhTecQRT7LUM1$s8g"><value name="btn"><shadow type="pins_button" id="J~)*sAM|JCTTq!ioDhB-"><field name="PIN">A3key</field></shadow></value></block></value><statement name="DO0"><block type="display_shift" id="xF.+(pR,,L(Yi3}Cj4Yi"><field name="OP">shift_up</field><value name="val"><shadow type="math_number" id="ry;)eH,67EAn,qJWVf5V"><field name="NUM">1</field></shadow></value></block></statement><next><block type="controls_if" id="bT1$]9*NDr#({k!49mxk"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="/}`!yG-OCNnE=nFF@@a/"><value name="btn"><shadow type="pins_button" id="~.Q.Z~^?q+tjcx9YPrsw"><field name="PIN">A4key</field></shadow></value></block></value><statement name="DO0"><block type="display_shift" id="e_Pk=2dx_|pZb#=-Hm92"><field name="OP">shift_right</field><value name="val"><shadow type="math_number" id="R(Q^ezGQZUP^k_mJU|L_"><field name="NUM">1</field></shadow></value></block></statement></block></next></block></next></block></next></block></statement></block></next></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9tYXRyaXgKaW1wb3J0IG1peGdvX2NjCgoKb25ib2FyZF9tYXRyaXgucGl4ZWwoaW50KDE2KSwgaW50KDYpLCAxKQpvbmJvYXJkX21hdHJpeC5zaG93KCkKd2hpbGUgVHJ1ZToKICAgIGlmIG1peGdvX2NjLkExa2V5Lndhc19wcmVzc2VkKCk6CiAgICAgICAgb25ib2FyZF9tYXRyaXguc2hpZnRfZG93bigxKQogICAgaWYgbWl4Z29fY2MuQTJrZXkud2FzX3ByZXNzZWQoKToKICAgICAgICBvbmJvYXJkX21hdHJpeC5zaGlmdF9sZWZ0KDEpCiAgICBpZiBtaXhnb19jYy5BM2tleS53YXNfcHJlc3NlZCgpOgogICAgICAgIG9uYm9hcmRfbWF0cml4LnNoaWZ0X3VwKDEpCiAgICBpZiBtaXhnb19jYy5BNGtleS53YXNfcHJlc3NlZCgpOgogICAgICAgIG9uYm9hcmRfbWF0cml4LnNoaWZ0X3JpZ2h0KDEpCg==</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="onboard_RTC_set_datetime" id="f9s[S#NssXs)TC:,e(TA" inline="true" x="-1886" y="-925"><value name="year"><shadow type="math_number" id="q^]bCJ^@hlrV3H=}1|(S"><field name="NUM">2024</field></shadow></value><value name="month"><shadow type="math_number" id="0vmhjt]vph`+a(Uz?hto"><field name="NUM">4</field></shadow></value><value name="day"><shadow type="math_number" id="I8E9H5_e4YmJObs0?(~o"><field name="NUM">2</field></shadow></value><value name="hour"><shadow type="math_number" id="lxgNbL0]*n?N*fP+8wR~"><field name="NUM">21</field></shadow></value><value name="minute"><shadow type="math_number" id="ZK4d$$@TEFoVnjB.3/y]"><field name="NUM">04</field></shadow></value><value name="second"><shadow type="math_number" id="MK$LZ^BCST)wlx[VY7x-"><field name="NUM">45</field></shadow></value><next><block type="controls_whileUntil" id="|~WtI`|@azL`)X,U_mo`"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="z|46b]bN=Rs9^VybX]52"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="system_print" id="dtDz|$8)`jh_{7m;CiV,"><value name="VAR"><shadow type="text" id="dlT9;Re7~yg)Qyw9vOi-"><field name="TEXT">Mixly</field></shadow><block type="onboard_RTC_get_time" id="CP@cb`gS84n!Y}.QCr,4"></block></value><next><block type="controls_delay_new" id="[RDZ@~v4`3|Kg3bl0tsL"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="S)[[;{N0+]_jH2J2yFJk"><field name="NUM">1</field></shadow></value></block></next></block></statement></block></next></block></xml><config>{}</config><code>aW1wb3J0IG50cHRpbWUKaW1wb3J0IG1hY2hpbmUKaW1wb3J0IHRpbWUKCgpudHB0aW1lLnNldHRpbWUoKDIwMjQsNCwyLDIxLDA0LDQ1LDAsMCkpCndoaWxlIFRydWU6CiAgICBwcmludCh0aW1lLmxvY2FsdGltZSgpKQogICAgdGltZS5zbGVlcCgxKQo=</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="onboard_RTC_set_datetime" id="#XW-APUz$VcC4k1Dd-X2" inline="true" x="-2187" y="-818"><value name="year"><shadow type="math_number" id="bLT,INjKUyE!R26DsJW~"><field name="NUM">2024</field></shadow></value><value name="month"><shadow type="math_number" id=";ehfs6J*c+X4hR,a!T6c"><field name="NUM">4</field></shadow></value><value name="day"><shadow type="math_number" id="?!ZfZ|P.!|O3s^0UV3=]"><field name="NUM">2</field></shadow></value><value name="hour"><shadow type="math_number" id=")UoUAO+GAfOy/_)Bt86{"><field name="NUM">21</field></shadow></value><value name="minute"><shadow type="math_number" id="c|r`PFK#p)@/-;sF:VnK"><field name="NUM">04</field></shadow></value><value name="second"><shadow type="math_number" id="BrCgxWCNhZ8,tP6yYndh"><field name="NUM">45</field></shadow></value><next><block type="controls_whileUntil" id=",o1;7*2L_uLEp-B(kL!D"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="fah~Y*e].F)3{2-4mvBt"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="variables_set" id="d(x;c6v{a8O]!Y6t#yU9"><field name="VAR">mytup</field><value name="VALUE"><block type="onboard_RTC_get_time" id="vfKqDS5(}8m9Y1Uk?2_O"></block></value><next><block type="display_scroll_string" id="ke2R*8LG]|+.OEzBr-9Y"><value name="data"><shadow type="text" id="9s66BJO!ZEpYN`QjW_@p"><field name="TEXT">Mixly</field></shadow><block type="text_format_noreturn" id="~]oWp9Obo82zPIb4))mx" inline="false"><mutation items="3"></mutation><value name="VAR"><shadow type="text" id="Am}vPhfhvi(E7Z}g:*gM"><field name="TEXT">{}:{}:{}</field></shadow></value><value name="ADD0"><block type="number_to_text" id="s:O3u)}Q{-k6FBOgPF3`"><value name="VAR"><shadow type="variables_get" id="DoVfu=)M{(?u~cH+.D9|"><field name="VAR">x</field></shadow><block type="tuple_getIndex" id="])j3Y@l4js6IIyB77Y?m"><value name="TUP"><shadow type="variables_get" id="1kFDBg2X/}Y$`L(l#Cmf"><field name="VAR">mytup</field></shadow></value><value name="AT"><shadow type="math_number" id="jooQ#oh#2F7LF@d?)t$|"><field name="NUM">3</field></shadow></value></block></value></block></value><value name="ADD1"><block type="number_to_text" id="Q`KC~p8f0m*rjBUwwNk3"><value name="VAR"><shadow type="variables_get" id="vinCgZ_-(=aZ{*fv!7X]"><field name="VAR">x</field></shadow><block type="tuple_getIndex" id="+nN@IUg6fzZM4}.$t-B5"><value name="TUP"><shadow type="variables_get" id="n@tx|cxVE2N{-O]2dwz2"><field name="VAR">mytup</field></shadow></value><value name="AT"><shadow type="math_number" id="z2SYhu@,]dJX/ONpVjN("><field name="NUM">4</field></shadow></value></block></value></block></value><value name="ADD2"><block type="number_to_text" id="2(nk{0wk;k3w2k9Qxx9|"><value name="VAR"><shadow type="variables_get" id="wPaeL{.yyB2Z|Pu;WOGa"><field name="VAR">x</field></shadow><block type="tuple_getIndex" id="yD=ib^hh~$W?#fZaG:tJ"><value name="TUP"><shadow type="variables_get" id="gp:n+]rz24@`).##apDt"><field name="VAR">mytup</field></shadow></value><value name="AT"><shadow type="math_number" id="Yj;r[yRt.t5k[Hf5c752"><field name="NUM">5</field></shadow></value></block></value></block></value></block></value><next><block type="controls_delay_new" id="l1}$dy?1nSaZQf*.X/I="><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="hR/iK?fC@{Fv4:=bdy9]"><field name="NUM">0.5</field></shadow></value></block></next></block></next></block></statement></block></next></block></xml><config>{}</config><code>aW1wb3J0IG50cHRpbWUKaW1wb3J0IHRpbWUKZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9tYXRyaXgKCgpudHB0aW1lLnNldHRpbWUoKDIwMjQsNCwyLDIxLDA0LDQ1LDAsMCkpCndoaWxlIFRydWU6CiAgICBteXR1cCA9IHRpbWUubG9jYWx0aW1lKCkKICAgIG9uYm9hcmRfbWF0cml4LnNjcm9sbCgne306e306e30nLmZvcm1hdChzdHIobXl0dXBbM10pLCBzdHIobXl0dXBbNF0pLCBzdHIobXl0dXBbNV0pKSkKICAgIHRpbWUuc2xlZXAoMC41KQo=</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="variables_set" id="SE1cY_ivZv$|WEg#Cc;_" x="-2099" y="-915"><field name="VAR">按下时刻</field><value name="VALUE"><block type="math_number" id="GG{cY6XG6AJ5;/+z.m1a"><field name="NUM">0</field></block></value><next><block type="variables_set" id="Y-@A:sRgtw#QB4u{$C7?"><field name="VAR">抬起时刻</field><value name="VALUE"><block type="math_number" id="B4A5L^eyv4-PTC[^R~]J"><field name="NUM">0</field></block></value><next><block type="controls_whileUntil" id="bo,yUp#9c0fcj`_Q57f5"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="wP[wEKLm#4zmwOQ05wsc"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="EM!n;S7,rfpiB]-8!q^3"><value name="IF0"><block type="sensor_mixgo_button_is_pressed" id="E^3p=YO-G7Uc$W9(26!O"><value name="btn"><shadow type="pins_button" id="b![ZD/7t3#@C3-:G`AS2"><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO0"><block type="variables_set" id="}=hOIsT_+^Zy}C].|juq"><field name="VAR">按下时刻</field><value name="VALUE"><block type="controls_millis" id="WrM9R)af7r)-wZs*)n1$"><field name="Time">ms</field></block></value><next><block type="do_while" id="h#kQsO@e#Y=`WS=c12HG"><field name="type">true</field><value name="select_data"><block type="logic_negate" id="YBWCsNqu=@0t=/X`#R(}"><value name="BOOL"><block type="sensor_mixgo_button_is_pressed" id="NvtCF=Ee*AoLUgU2mHf#"><value name="btn"><shadow type="pins_button" id="(PZ*s4.lATQ|(D.v6.cl"><field name="PIN">B1key</field></shadow></value></block></value></block></value><next><block type="variables_set" id="p;9jJrSb8w)7K}Cb^RhN"><field name="VAR">抬起时刻</field><value name="VALUE"><block type="controls_millis" id="}R]A`dgFC{]^;)M6@9|o"><field name="Time">ms</field></block></value><next><block type="system_print" id="l^w^x;Qy5xiXe)58FF@*"><value name="VAR"><shadow type="text" id="gb{G`.{qYVv~90HtM}UM"><field name="TEXT">Mixly</field></shadow><block type="math_arithmetic" id="^z?GaM)}/`=Nm04*8X5S"><field name="OP">MINUS</field><value name="A"><shadow type="math_number" id="z`Q7yIVpns2gJ2`j$Lnx"><field name="NUM">1</field></shadow><block type="variables_get" id="l;M,s,vMI-M2[Bnm!+!a"><field name="VAR">抬起时刻</field></block></value><value name="B"><shadow type="math_number" id="{{K+P_{:f#CY.mmcMg|L"><field name="NUM">1</field></shadow><block type="variables_get" id="_SAMyrbbHHxK}a.01Utx"><field name="VAR">按下时刻</field></block></value></block></value><next><block type="display_show_image_or_string_delay" id="rp};2FSrvI*UtlEN1B9("><field name="center">True</field><value name="data"><shadow type="text" id="io]#$x=.31^[eQRu`2@A"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="UEM9L]PbTuNetY@+0NB,"><value name="VAR"><shadow type="variables_get" id="Chg#}Y;=nVZo!~ypzD`,"><field name="VAR">x</field></shadow><block type="math_arithmetic" id="{se}IoVK@Qhi*U!$Pi^-"><field name="OP">MINUS</field><value name="A"><shadow type="math_number" id="pwcq*L[Jbc?XZ8Q9IAr."><field name="NUM">1</field></shadow><block type="variables_get" id="YR*?p.OcGD6b-VyA}+`K"><field name="VAR">抬起时刻</field></block></value><value name="B"><shadow type="math_number" id="D*U.cEnpZj|hHIbp],xI"><field name="NUM">1</field></shadow><block type="variables_get" id="gNA)_^s;0V-uM/-nBQX1"><field name="VAR">按下时刻</field></block></value></block></value></block></value><value name="space"><shadow type="math_number" id="20QAB?,uwR{qe{ziw{cN"><field name="NUM">0</field></shadow></value></block></next></block></next></block></next></block></next></block></statement></block></statement></block></next></block></next></block></xml><config>{}</config><code>aW1wb3J0IG1peGdvX2NjCmltcG9ydCB0aW1lCmltcG9ydCBtYWNoaW5lCmZyb20gbWl4Z29fY2MgaW1wb3J0IG9uYm9hcmRfbWF0cml4CgoKX0U2XzhDXzg5X0U0X0I4XzhCX0U2Xzk3X0I2X0U1Xzg4X0JCID0gMApfRTZfOEFfQUNfRThfQjVfQjdfRTZfOTdfQjZfRTVfODhfQkIgPSAwCndoaWxlIFRydWU6CiAgICBpZiBtaXhnb19jYy5CMWtleS5pc19wcmVzc2VkKCk6CiAgICAgICAgX0U2XzhDXzg5X0U0X0I4XzhCX0U2Xzk3X0I2X0U1Xzg4X0JCID0gdGltZS50aWNrc19tcygpCiAgICAgICAgd2hpbGUgVHJ1ZToKICAgICAgICAgICAgaWYgKG5vdCBtaXhnb19jYy5CMWtleS5pc19wcmVzc2VkKCkpOgogICAgICAgICAgICAgICAgYnJlYWsKICAgICAgICBfRTZfOEFfQUNfRThfQjVfQjdfRTZfOTdfQjZfRTVfODhfQkIgPSB0aW1lLnRpY2tzX21zKCkKICAgICAgICBwcmludCgoX0U2XzhBX0FDX0U4X0I1X0I3X0U2Xzk3X0I2X0U1Xzg4X0JCIC0gX0U2XzhDXzg5X0U0X0I4XzhCX0U2Xzk3X0I2X0U1Xzg4X0JCKSkKICAgICAgICBvbmJvYXJkX21hdHJpeC5zaG93cyhzdHIoKF9FNl84QV9BQ19FOF9CNV9CN19FNl85N19CNl9FNV84OF9CQiAtIF9FNl84Q184OV9FNF9COF84Ql9FNl85N19CNl9FNV84OF9CQikpLHNwYWNlID0gMCxjZW50ZXIgPSBUcnVlKQo=</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 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="controls_whileUntil" id=",D^1W09[-fC$!-~boVp," x="-2754" y="-915"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="0$P?/87CHFYdCH.fJBlI"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="display_show_image" id="YNVKl]8fsi3[NRlIqe7r"><value name="data"><shadow type="pins_builtinimg" id="@CJ=IlqSvmJ#_bKcocx@"><field name="PIN">onboard_matrix.HEART</field></shadow></value><next><block type="controls_delay_new" id="jCd.ao]^gIQ{i}}39IMa"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="Z!|v|z90z`zS#cJHW,JL"><field name="NUM">0.5</field></shadow></value><next><block type="display_show_image" id="SByB~1cPI/k(C=KsEN?n"><value name="data"><shadow type="pins_builtinimg" id="xp4=9XywSfp}qBP=tlYG"><field name="PIN">onboard_matrix.HEART_SMALL</field></shadow></value><next><block type="controls_delay_new" id="p]d:JbXcQi8qqD/h2P8~"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="4=U2^n=Piq_0gLIL,8GM"><field name="NUM">0.5</field></shadow></value><next><block type="controls_if" id="[PH5aU19]34$|~a1GhYk"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="JFGXLd.CO/?5BRrtS1?J"><value name="btn"><shadow type="pins_button" id="4-Uq*dJq5G#mM{l,Z0IR"><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO0"><block type="actuator_onboard_neopixel_rgb_all" id="Zn@`c84L1V1T~wE2.Q_|"><value name="RVALUE"><shadow type="math_number" id="!x)3pHb`Ma.q*^:P{-IC"><field name="NUM">10</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="G~Y_69EccvHjAzg6AA{G"><field name="NUM">10</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="[pg49YT#fx#9)#N)D8-}"><field name="NUM">10</field></shadow></value><next><block type="actuator_onboard_neopixel_write" id="k^Viz=vD#xm[Q_CvO2D$"></block></next></block></statement><next><block type="controls_if" id="N/J.bpa/k9QL_Q=)7LNd"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="!P(*l[bjYvpBtC!NaB?C"><value name="btn"><shadow type="pins_button" id="~t+7JlCAKCi~ARDU_2h3"><field name="PIN">B2key</field></shadow></value></block></value><statement name="DO0"><block type="actuator_onboard_neopixel_rgb_all" id="c=/P#gP5hh/#Iv9C*kfN"><value name="RVALUE"><shadow type="math_number" id="m^1J0IUE;-PQCGL+692x"><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="CFO955cqPfFfPjf?i(~b"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="B~dFo{o{=:o2NJh!Y(3T"><field name="NUM">0</field></shadow></value><next><block type="actuator_onboard_neopixel_write" id="RF#dg*,pNA,qK?NzasXf"></block></next></block></statement></block></next></block></next></block></next></block></next></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9tYXRyaXgKaW1wb3J0IHRpbWUKaW1wb3J0IG1peGdvX2NjCmZyb20gbWl4Z29fY2MgaW1wb3J0IG9uYm9hcmRfcmdiCgoKd2hpbGUgVHJ1ZToKICAgIG9uYm9hcmRfbWF0cml4LnNob3dzKG9uYm9hcmRfbWF0cml4LkhFQVJUKQogICAgdGltZS5zbGVlcCgwLjUpCiAgICBvbmJvYXJkX21hdHJpeC5zaG93cyhvbmJvYXJkX21hdHJpeC5IRUFSVF9TTUFMTCkKICAgIHRpbWUuc2xlZXAoMC41KQogICAgaWYgbWl4Z29fY2MuQjFrZXkud2FzX3ByZXNzZWQoKToKICAgICAgICBvbmJvYXJkX3JnYi5maWxsKCgxMCwgMTAsIDEwKSkKICAgICAgICBvbmJvYXJkX3JnYi53cml0ZSgpCiAgICBpZiBtaXhnb19jYy5CMmtleS53YXNfcHJlc3NlZCgpOgogICAgICAgIG9uYm9hcmRfcmdiLmZpbGwoKDAsIDAsIDApKQogICAgICAgIG9uYm9hcmRfcmdiLndyaXRlKCkK</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><variables><variable id="kujED6C|3`}2*o!`dvF;">x</variable></variables><block type="sensor_mixgo_button_attachInterrupt" id="vidEC/9p?.F[Z-!9BNq=" x="-2776" y="-1011"><field name="mode">machine.Pin.IRQ_RISING</field><value name="btn"><shadow type="pins_button" id="?(Uw-0Zo`;D|DO2a,Gf8"><field name="PIN">B1key</field></shadow></value><value name="DO"><shadow type="factory_block_return" id="I4p$;qK6G{m{vKD#j@!n"><field name="VALUE">attachInterrupt_func</field></shadow></value><next><block type="sensor_mixgo_button_attachInterrupt" id="``/#xebz!(ViGcdO08I="><field name="mode">machine.Pin.IRQ_RISING</field><value name="btn"><shadow type="pins_button" id="P8JDEaJrlK^IgJ=!g3Dp"><field name="PIN">B2key</field></shadow></value><value name="DO"><shadow type="factory_block_return" id="[=4vQ7G33SxgF8G.En`}"><field name="VALUE">attachInterrupt_func2</field></shadow></value><next><block type="controls_whileUntil" id="fp,F~2@#6Q_jaq(3X{fZ"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="$CWUvF3[/_NM?B`[h2C="><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="display_show_image" id="hT.AmagR)(IY4l=[+szd"><value name="data"><shadow type="pins_builtinimg" id="H7hOypTwF{79Cp,QhSpO"><field name="PIN">onboard_matrix.HEART</field></shadow></value><next><block type="controls_delay_new" id="H,,BwsALRBsiw5;E5L/Q"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="ef?0+A))l-k!0`xj}vPy"><field name="NUM">0.5</field></shadow></value><next><block type="display_show_image" id="Ha?fWp?78GBr@E00Oyzn"><value name="data"><shadow type="pins_builtinimg" id="71d4?+ABLEr+8r^XT{-y"><field name="PIN">onboard_matrix.HEART_SMALL</field></shadow></value><next><block type="controls_delay_new" id="YX4E5/R.*D/3fmQi:#6n"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="j|QhrjDEdDQ3|x2,MoL?"><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="Pae|LH)})2}xtEk5]=tE" 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="R8v(Gw#BG@HS-/CdQZdN"><value name="RVALUE"><shadow type="math_number" id="cK?dU:hsS1@Y[~!VRLlk"><field name="NUM">10</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="k`,dnqZEcs#o(Riwm_6O"><field name="NUM">10</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="L)zdf{X?h1jFc#m=}#PY"><field name="NUM">10</field></shadow></value><next><block type="actuator_onboard_neopixel_write" id="9N=ahC.56EMsBpLQ,dwh"></block></next></block></statement></block><block type="procedures_defnoreturn" id="S}_S2L+i+;uq0Ss:.*`#" x="-2523" y="-626"><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="Jsm11/_n+V7fMJI:]{G3"><value name="RVALUE"><shadow type="math_number" id="[lYU;cU4(C025@G^)VQW"><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="C1rB4E[Sy]*{7ds7X2k6"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="UB/!LkD1K(+oolUyc+V."><field name="NUM">0</field></shadow></value><next><block type="actuator_onboard_neopixel_write" id="oe*cu}?;;xV6bS@RIeXA"></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1hY2hpbmUKaW1wb3J0IG1peGdvX2NjCmZyb20gbWl4Z29fY2MgaW1wb3J0IG9uYm9hcmRfbWF0cml4CmltcG9ydCB0aW1lCmZyb20gbWl4Z29fY2MgaW1wb3J0IG9uYm9hcmRfcmdiCgpkZWYgYXR0YWNoSW50ZXJydXB0X2Z1bmMoeCk6CiAgICBvbmJvYXJkX3JnYi5maWxsKCgxMCwgMTAsIDEwKSkKICAgIG9uYm9hcmRfcmdiLndyaXRlKCkKCmRlZiBhdHRhY2hJbnRlcnJ1cHRfZnVuYzIoeCk6CiAgICBvbmJvYXJkX3JnYi5maWxsKCgwLCAwLCAwKSkKICAgIG9uYm9hcmRfcmdiLndyaXRlKCkKCgoKbWl4Z29fY2MuQjFrZXkuaXJxKGhhbmRsZXIgPSBhdHRhY2hJbnRlcnJ1cHRfZnVuYywgdHJpZ2dlciA9IG1hY2hpbmUuUGluLklSUV9SSVNJTkcpCm1peGdvX2NjLkIya2V5LmlycShoYW5kbGVyID0gYXR0YWNoSW50ZXJydXB0X2Z1bmMyLCB0cmlnZ2VyID0gbWFjaGluZS5QaW4uSVJRX1JJU0lORykKd2hpbGUgVHJ1ZToKICAgIG9uYm9hcmRfbWF0cml4LnNob3dzKG9uYm9hcmRfbWF0cml4LkhFQVJUKQogICAgdGltZS5zbGVlcCgwLjUpCiAgICBvbmJvYXJkX21hdHJpeC5zaG93cyhvbmJvYXJkX21hdHJpeC5IRUFSVF9TTUFMTCkKICAgIHRpbWUuc2xlZXAoMC41KQo=</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><variables><variable id="kujED6C|3`}2*o!`dvF;">x</variable></variables><block type="variables_set" id="2~P2ooGmV0PtT![?;J(g" x="-2776" y="-1041"><field name="VAR">是否亮灯</field><value name="VALUE"><block type="logic_boolean" id="L/=~0*Re[upoo^vy}JOM"><field name="BOOL">FALSE</field></block></value><next><block type="sensor_mixgo_button_attachInterrupt" id="Z=7t/M~}h:`1pC2-*8nr"><field name="mode">machine.Pin.IRQ_RISING</field><value name="btn"><shadow type="pins_button" id="ryhY`*]?G;?n#u4yIlk:"><field name="PIN">B1key</field></shadow></value><value name="DO"><shadow type="factory_block_return" id="s+`i*F@8P6J(9;[[UwcC"><field name="VALUE">attachInterrupt_func</field></shadow></value><next><block type="controls_whileUntil" id="ZpOKUrd;=#U0F#7[c}_1"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="h@cTJnH#~8b30*]lRYbX"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="display_show_image" id="!xFVNX_LzMt*y2:RF-Ty"><value name="data"><shadow type="pins_builtinimg" id="bdbCw[5x47r#-^^tAN#M"><field name="PIN">onboard_matrix.HEART</field></shadow></value><next><block type="controls_delay_new" id="J-*lMH_uj}0Qk}wr,;D,"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="=Oj8Jjv_Ea^Shf,ZuDoc"><field name="NUM">0.5</field></shadow></value><next><block type="display_show_image" id="}POjpT!S(e+D:Doqytr^"><value name="data"><shadow type="pins_builtinimg" id="m`ANtkmDO?x(qPf80rSH"><field name="PIN">onboard_matrix.HEART_SMALL</field></shadow></value><next><block type="controls_delay_new" id="T@}o_gm]dWV8pYaW_@J_"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="A.u+VZ#@FzbdT_z3|LOG"><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="+E8S,Mzf+lQ6pLA^FM`J" x="-2787" y="-716"><mutation><arg name="x" varid="kujED6C|3`}2*o!`dvF;"></arg></mutation><field name="NAME">attachInterrupt_func</field><statement name="STACK"><block type="variables_global" id="R8^MvU;}9*PFZ`t-bg~`"><value name="VAR"><block type="variables_get" id=".EUI)4CNL;A||4X*.Cg4"><field name="VAR">是否亮灯</field></block></value><next><block type="variables_set" id="?nD)?vVRXXHfOL6kqsy5"><field name="VAR">是否亮灯</field><value name="VALUE"><block type="logic_negate" id="dKGd,v4JFtvyBzK.kk3q"><value name="BOOL"><block type="variables_get" id="~mp:gC`dE.q?#!}heCk}"><field name="VAR">是否亮灯</field></block></value></block></value><next><block type="controls_if" id="1,o/H@=/nMt`:iLvx==Q"><mutation else="1"></mutation><value name="IF0"><block type="variables_get" id="-+eioZnfY(cY{WUxkWTj"><field name="VAR">是否亮灯</field></block></value><statement name="DO0"><block type="actuator_onboard_neopixel_rgb_all" id="`Hi:B_`?7)uibhz|@jL4"><value name="RVALUE"><shadow type="math_number" id="OewBf9)gh(*]?_ep/rPe"><field name="NUM">10</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="7[}#82tXK8-$i:t*xCcf"><field name="NUM">10</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="?}[a+|4*8K4!ZqRcBosV"><field name="NUM">10</field></shadow></value></block></statement><statement name="ELSE"><block type="actuator_onboard_neopixel_rgb_all" id="W1=sSVPqeCO_hd[rlG]5"><value name="RVALUE"><shadow type="math_number" id="AF1EL:4.P;eS@ykKQZ/V"><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id=".b[sndC)eFzHF)?rDo+X"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="t,76}s3en+yKWEZCza`I"><field name="NUM">0</field></shadow></value></block></statement><next><block type="actuator_onboard_neopixel_write" id="~39frBHad!ZpSoS;^$^;"></block></next></block></next></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1hY2hpbmUKaW1wb3J0IG1peGdvX2NjCmZyb20gbWl4Z29fY2MgaW1wb3J0IG9uYm9hcmRfbWF0cml4CmltcG9ydCB0aW1lCmZyb20gbWl4Z29fY2MgaW1wb3J0IG9uYm9hcmRfcmdiCgpkZWYgYXR0YWNoSW50ZXJydXB0X2Z1bmMoeCk6CiAgICBnbG9iYWwgX0U2Xzk4X0FGX0U1XzkwX0E2X0U0X0JBX0FFX0U3XzgxX0FGCiAgICBfRTZfOThfQUZfRTVfOTBfQTZfRTRfQkFfQUVfRTdfODFfQUYgPSBub3QgX0U2Xzk4X0FGX0U1XzkwX0E2X0U0X0JBX0FFX0U3XzgxX0FGCiAgICBpZiBfRTZfOThfQUZfRTVfOTBfQTZfRTRfQkFfQUVfRTdfODFfQUY6CiAgICAgICAgb25ib2FyZF9yZ2IuZmlsbCgoMTAsIDEwLCAxMCkpCiAgICBlbHNlOgogICAgICAgIG9uYm9hcmRfcmdiLmZpbGwoKDAsIDAsIDApKQogICAgb25ib2FyZF9yZ2Iud3JpdGUoKQoKCgpfRTZfOThfQUZfRTVfOTBfQTZfRTRfQkFfQUVfRTdfODFfQUYgPSBGYWxzZQptaXhnb19jYy5CMWtleS5pcnEoaGFuZGxlciA9IGF0dGFjaEludGVycnVwdF9mdW5jLCB0cmlnZ2VyID0gbWFjaGluZS5QaW4uSVJRX1JJU0lORykKd2hpbGUgVHJ1ZToKICAgIG9uYm9hcmRfbWF0cml4LnNob3dzKG9uYm9hcmRfbWF0cml4LkhFQVJUKQogICAgdGltZS5zbGVlcCgwLjUpCiAgICBvbmJvYXJkX21hdHJpeC5zaG93cyhvbmJvYXJkX21hdHJpeC5IRUFSVF9TTUFMTCkKICAgIHRpbWUuc2xlZXAoMC41KQo=</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><variables><variable id="ok:ro0iEW(eJAtg/iAsj">tim</variable></variables><block type="variables_set" id="2V_aC/Ck;gMZ^1{=4Ew4" x="-2908" y="-1031"><field name="VAR">开始</field><value name="VALUE"><block type="logic_boolean" id="5|jyCscqk*t:]N?+#.^Z"><field name="BOOL">FALSE</field></block></value><next><block type="variables_set" id="r8pj`C:{_`I4N?XO6r.y"><field name="VAR">计时</field><value name="VALUE"><block type="math_number" id="?ITcjjPBHctG98iyxHei"><field name="NUM">0</field></block></value><next><block type="system_timer_init" id="Q)J?T^sZHb2`o#.64?xY"><value name="SUB"><shadow type="variables_get" id="nKF9vzqGmEr9@PtkvD*O"><field name="VAR">tim</field></shadow></value><next><block type="system_timer" id="G??4LrB7|l]?Sg$op7gi"><field name="mode">PERIODIC</field><value name="VAR"><shadow type="variables_get" id="3I{;v3j^/@/}h`d=U8JB"><field name="VAR">tim</field></shadow></value><value name="period"><shadow type="math_number" id="aHw8|=Ea;-2Jb31:$ZJ#"><field name="NUM">100</field></shadow></value><value name="callback"><shadow type="factory_block_return" id="z@5T[TKP_Pf(7U2~pdfY"><field name="VALUE">tim_callback</field></shadow></value><next><block type="controls_whileUntil" id="*+F:N^RKh.Rjvp24)s(O"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="#XSvlDsHX|cxszBT!9#N"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="^frHvN*1)[rZ[#x:;|1X"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="^LhW,bB8*IL.r$74P0d9"><value name="btn"><shadow type="pins_button" id="BnvJa3CyfB84y#s?~p05"><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO0"><block type="variables_set" id="Y@=H3yjix2vgW?5|{z|O"><field name="VAR">开始</field><value name="VALUE"><block type="logic_negate" id="2qDOpC~gC?}By!t!`{b+"><value name="BOOL"><block type="variables_get" id="I=Y@[GqkbrH`?2IB[{Wl"><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="_9VA@.$76JMpkr8]}BG`" 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="G6{c9rN{Y(zUf6^@+89k"><value name="VAR"><block type="variables_get" id="*7)GcgJTrbI,TbW_alld"><field name="VAR">计时</field></block></value><next><block type="variables_global" id="Qlk65IT6AG}ys1OG3]$c"><value name="VAR"><block type="variables_get" id="QDFF/FItpzPRqTf+i[?Q"><field name="VAR">开始</field></block></value><next><block type="controls_if" id="_*cC2WNmE5[puq[HP[a^"><value name="IF0"><block type="variables_get" id="_;E`YqFRz8qkS8T,qZ.2"><field name="VAR">开始</field></block></value><statement name="DO0"><block type="math_selfcalcu" id="C#u]n64;Yf5cUH#7#Dv8"><field name="OP">ADD</field><value name="A"><shadow type="variables_get" id="iht@gniX.xgGQXh9K`El"><field name="VAR">a</field></shadow><block type="variables_get" id="8Z_6@P(@NM=X}|t?;he5"><field name="VAR">计时</field></block></value><value name="B"><shadow type="math_number" id="*j0UjV048$~/y)aI`[_7"><field name="NUM">1</field></shadow></value></block></statement><next><block type="display_show_image_or_string_delay" id="6Idg=A^GIc2A_CN[E3S:"><field name="center">True</field><value name="data"><shadow type="text" id="W{1Ql?Bd*oH`dD{.lf1U"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="~hCVA_LD!oohcQ/s#,=r"><value name="VAR"><shadow type="variables_get" id="W6uL?oLkL:BpG?B[I;*S"><field name="VAR">x</field></shadow><block type="variables_get" id="J2d?!bDWPZHY|siWB8Nm"><field name="VAR">计时</field></block></value></block></value><value name="space"><shadow type="math_number" id="K23|YNXi[awH*o3T/Ohj"><field name="NUM">0</field></shadow></value></block></next></block></next></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1hY2hpbmUKaW1wb3J0IG1peGdvX2NjCmZyb20gbWl4Z29fY2MgaW1wb3J0IG9uYm9hcmRfbWF0cml4CgpkZWYgdGltX2NhbGxiYWNrKHRpbSk6CiAgICBnbG9iYWwgX0U4X0FFX0ExX0U2Xzk3X0I2CiAgICBnbG9iYWwgX0U1X0JDXzgwX0U1X0E3XzhCCiAgICBpZiBfRTVfQkNfODBfRTVfQTdfOEI6CiAgICAgICAgX0U4X0FFX0ExX0U2Xzk3X0I2ICs9IDEKICAgIG9uYm9hcmRfbWF0cml4LnNob3dzKHN0cihfRThfQUVfQTFfRTZfOTdfQjYpLHNwYWNlID0gMCxjZW50ZXIgPSBUcnVlKQoKCgpfRTVfQkNfODBfRTVfQTdfOEIgPSBGYWxzZQpfRThfQUVfQTFfRTZfOTdfQjYgPSAwCnRpbSA9IG1hY2hpbmUuVGltZXIoMCkKdGltLmluaXQocGVyaW9kID0gMTAwLCBtb2RlID0gbWFjaGluZS5UaW1lci5QRVJJT0RJQywgY2FsbGJhY2sgPSB0aW1fY2FsbGJhY2spCndoaWxlIFRydWU6CiAgICBpZiBtaXhnb19jYy5CMWtleS53YXNfcHJlc3NlZCgpOgogICAgICAgIF9FNV9CQ184MF9FNV9BN184QiA9IG5vdCBfRTVfQkNfODBfRTVfQTdfOEIK</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 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="controls_whileUntil" id="IPc=))t6.;}w]2ntvbIF" x="-3074" y="-1055"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="*Ym?;k)w?5ZNu{R#MF4K"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="display_show_image" id="75aFGp/TGPRXu`Svl^ys"><value name="data"><shadow type="pins_builtinimg" id="9n3;)n52gU_`7Y@I#U9m"><field name="PIN">onboard_matrix.HEART</field></shadow></value><next><block type="controls_delay_new" id="Q(0ewuP17,5v3GF$-Vg)"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="_$.ks)0$dW93+$5f-_+W"><field name="NUM">0.1</field></shadow></value><next><block type="display_show_image" id="eYa(:_kSb+;n+:}n$u0@"><value name="data"><shadow type="pins_builtinimg" id="iVth6[=`cbP)dVkERBTT"><field name="PIN">onboard_matrix.HEART_SMALL</field></shadow></value><next><block type="controls_delay_new" id="AJulyKinW.}Qfj4rC!?{"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id=":71po~Zac}|d,v:aK^MB"><field name="NUM">0.1</field></shadow></value><next><block type="variables_set" id="#.$t^}uGqN:~Q1s0bM+#"><field name="VAR">错误变量</field><value name="VALUE"><block type="logic_negate" id="HZvg{v{vUStE$y=6Fly~"><value name="BOOL"><block type="variables_get" id="Kt?t#M9*zH4V-XIV;#P:"><field name="VAR">错误变量</field></block></value></block></value></block></next></block></next></block></next></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9tYXRyaXgKaW1wb3J0IHRpbWUKCgp3aGlsZSBUcnVlOgogICAgb25ib2FyZF9tYXRyaXguc2hvd3Mob25ib2FyZF9tYXRyaXguSEVBUlQpCiAgICB0aW1lLnNsZWVwKDAuMSkKICAgIG9uYm9hcmRfbWF0cml4LnNob3dzKG9uYm9hcmRfbWF0cml4LkhFQVJUX1NNQUxMKQogICAgdGltZS5zbGVlcCgwLjEpCiAgICBfRTlfOTRfOTlfRThfQUZfQUZfRTVfOEZfOThfRTlfODdfOEYgPSBub3QgX0U5Xzk0Xzk5X0U4X0FGX0FGX0U1XzhGXzk4X0U5Xzg3XzhGCg==</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="controls_whileUntil" id="_!bJ,=bv4=uvU:?)RIGE" x="-3074" y="-1055"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="{np.mHSt;mevdQ|@H~Hf"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="display_show_image" id="dzw,qU2|JuK}iKN97]`0"><value name="data"><shadow type="pins_builtinimg" id="z@H5rS?.QDjKPvmYp95|"><field name="PIN">onboard_matrix.HEART</field></shadow></value><next><block type="controls_delay_new" id="c.d`Ve8N6lO9wE5UXG-b"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="-i]`GvSqWt{o[fcj,ER9"><field name="NUM">0.1</field></shadow></value><next><block type="display_show_image" id="aAQbGurmE7V}a_5ue?:g"><value name="data"><shadow type="pins_builtinimg" id="e]h#d0d2L+9T|PX5N@,J"><field name="PIN">onboard_matrix.HEART_SMALL</field></shadow></value><next><block type="controls_delay_new" id=")du)GR1J?CUzv2c2a26r"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="?pQeYxUplUwqCiW#p/nC"><field name="NUM">0.1</field></shadow></value><next><block type="controls_try_finally" id="$8L,OTYujgcAtF)4QA_n"><mutation elseif="1"></mutation><statement name="try"><block type="variables_set" id="ZClB=h|9P_`lggb7yn)0"><field name="VAR">错误变量</field><value name="VALUE"><block type="logic_negate" id="Zs0`e[w_CUx2ENx,E5!q"><value name="BOOL"><block type="variables_get" id="ZM/Gsyu~SU;=Lp5.|HXj"><field name="VAR">错误变量</field></block></value></block></value></block></statement><value name="IF1"><shadow type="factory_block_return" id="|zHnUhFSxw=#Zp-3)C5}"><field name="VALUE">Exception as e</field></shadow></value><statement name="DO1"><block type="system_print" id=")[L=n#U4P|Fg=Bd[?GkK" disabled="true"><value name="VAR"><block type="variables_get" id="-Y3|YbDbC8b6LTj`m6Z7"><field name="VAR">e</field></block></value></block></statement></block></next></block></next></block></next></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9tYXRyaXgKaW1wb3J0IHRpbWUKCgp3aGlsZSBUcnVlOgogICAgb25ib2FyZF9tYXRyaXguc2hvd3Mob25ib2FyZF9tYXRyaXguSEVBUlQpCiAgICB0aW1lLnNsZWVwKDAuMSkKICAgIG9uYm9hcmRfbWF0cml4LnNob3dzKG9uYm9hcmRfbWF0cml4LkhFQVJUX1NNQUxMKQogICAgdGltZS5zbGVlcCgwLjEpCiAgICB0cnk6CiAgICAgICAgX0U5Xzk0Xzk5X0U4X0FGX0FGX0U1XzhGXzk4X0U5Xzg3XzhGID0gbm90IF9FOV85NF85OV9FOF9BRl9BRl9FNV84Rl85OF9FOV84N184RgogICAgZXhjZXB0IEV4Y2VwdGlvbiBhcyBlOgogICAgICAgIHBhc3MK</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="controls_whileUntil" id="z38;_Rzmdd62^K+YFvY;" x="-3394" y="-997"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id=";Rjs]S$so(#Nz@rLd;J7"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="system_print" id="x?6?8uIPv.4:X~^cH`Ji"><value name="VAR"><shadow type="text" id="RUZG!E2eLbS_sl]Jv^.6"><field name="TEXT">Mixly</field></shadow><block type="rfid_readid" id="gz[404*#3#$P!z?R0Fw~"></block></value><next><block type="controls_delay_new" id="=xwFpPG7CR|M1EdDQAG6"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="nlcB[eTX[s5-2|)qUBuy"><field name="NUM">1</field></shadow></value></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1hY2hpbmUKZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9yZmlkCmltcG9ydCB0aW1lCgoKd2hpbGUgVHJ1ZToKICAgIHByaW50KG9uYm9hcmRfcmZpZC5yZWFkX2NhcmQoMCwgeD0iaWQiKSkKICAgIHRpbWUuc2xlZXAoMSkK</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="variables_set" id="H`+0pT|x{=$}yrpq43m|" x="-3403" y="-1132"><field name="VAR">id</field><value name="VALUE"><block type="math_number" id="te[+N-Lw:A*VSC/VgwnW"><field name="NUM">0</field></block></value><next><block type="controls_whileUntil" id="fLUO)]?G9+_$-JPu;[/J"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="-#glos[yKdJh4.?Y{jGd"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="variables_set" id="D;?!.}0R;!M}1`d7t)eZ"><field name="VAR">id</field><value name="VALUE"><block type="rfid_readid" id=";do[Bn`3pFxA}rm?e3he"></block></value><next><block type="controls_if" id="DNlGi[PLrm*kPE_!7M}R"><value name="IF0"><block type="logic_compare" id="1M,FH)}0c,]k:bHV(mvd"><field name="OP">NEQ</field><value name="A"><block type="number_to_text" id="9Ug?#-ot6Of)bkTrq~bC"><value name="VAR"><shadow type="variables_get" id="vC4iIzLb`Qh)j^L`*Y*w"><field name="VAR">x</field></shadow><block type="variables_get" id="/-ri/kmIZzx^Dc.;Eyt@"><field name="VAR">id</field></block></value></block></value><value name="B"><block type="text" id="!Q5h0w*a.kjwN/QpgKsh"><field name="TEXT">None</field></block></value></block></value><statement name="DO0"><block type="esp32_onboard_music_pitch_with_time" id="*`U=PMro[;wB4(0Yt=Ej"><value name="pitch"><shadow type="pins_tone_notes" id="4_b_}oT:(w3W;v{G1`#$"><field name="PIN">659</field></shadow></value><value name="time"><shadow type="math_number" id="E`Ei6y6Y:/3(+:ikwqbW"><field name="NUM">100</field></shadow></value><next><block type="system_print" id="GE/BDXMNbS*RtJLw#a.+"><value name="VAR"><shadow type="text" id="dcX.YOM[[!6Ui!Nmooh="><field name="TEXT">Mixly</field></shadow><block type="variables_get" id="R4lMTx0I)7o$^qY$t,.t"><field name="VAR">id</field></block></value><next><block type="display_scroll_string" id="bEJE3.G3}c4R/B]rdLZu"><value name="data"><shadow type="text" id="Z!+|$Pdui+EKYv.Y7Ej~"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="gK)k[QX8QsrMs|b[d@r|"><value name="VAR"><shadow type="variables_get" id="1E-s_]m|Ro[tc~ai0mE4"><field name="VAR">x</field></shadow><block type="variables_get" id="EX[+*F3v_h:Ukl7BZ`4i"><field name="VAR">id</field></block></value></block></value></block></next></block></next></block></statement></block></next></block></statement></block></next></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9yZmlkCmZyb20gbWl4Z29fY2MgaW1wb3J0IG9uYm9hcmRfbXVzaWMKaW1wb3J0IG1hY2hpbmUKZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9tYXRyaXgKCgppZDIgPSAwCndoaWxlIFRydWU6CiAgICBpZDIgPSBvbmJvYXJkX3JmaWQucmVhZF9jYXJkKDAsIHg9ImlkIikKICAgIGlmIHN0cihpZDIpICE9ICdOb25lJzoKICAgICAgICBvbmJvYXJkX211c2ljLnBpdGNoX3RpbWUoNjU5LCAxMDApCiAgICAgICAgcHJpbnQoaWQyKQogICAgICAgIG9uYm9hcmRfbWF0cml4LnNjcm9sbChzdHIoaWQyKSkK</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 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="espnow_radio_channel" id="Y^Jl8Nm+$C#Rq+:xyP_7" x="-912" y="-519"><value name="CHNL"><shadow type="espnow_channel" id="Mobx._Xl4|bJT$!~}2l1"><field name="PIN">10</field></shadow></value><next><block type="espnow_radio_on_off" id="rxIGD.I3NDrSc:|][iIs"><field name="on_off">True</field><next><block type="controls_whileUntil" id="VK?gdD8+.V*=woYzH.HD"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="XH?r,^80AaToW:+~WJYR"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="63Q?O786|j_//}q[sdAE"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="3Ngd7Sji7KqePi#g_?1#"><value name="btn"><shadow type="pins_button" id="Q{[j[26*J6yXBHW9~F$G"><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO0"><block type="espnow_radio_send" id="RH|jaq9,Zl8~U3*R;9nD"><value name="send"><shadow type="text" id="41CtzXjo_!1/,UcxcHSx"><field name="TEXT">LEFT</field></shadow></value></block></statement><next><block type="controls_if" id="S39edOT_~3+:oSMVWC~O"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="HBHx-]6~T(T7WtaY;O:9"><value name="btn"><shadow type="pins_button" id="2870jD8W1t|G{Jj4g/z,"><field name="PIN">B2key</field></shadow></value></block></value><statement name="DO0"><block type="espnow_radio_send" id="Rc*1w3].w?(_]c-:]5pL"><value name="send"><shadow type="text" id=".rfN8n?y/SQ4qLNLOMi:"><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="5Wp7DRdB#ILP0=2+MdTz" x="-894" y="-189"><statement name="DO"><block type="system_print" id="[^/3`){o+X:n27l)0QE:"><value name="VAR"><block type="espnow_radio_recv_msg" id="s1cnMte(mkt_XY6e~@1j"></block></value></block></statement></block><block type="espnow_radio_recv_certain_msg_new" id="C*Wsmv]qI7lqGt8^~D/a" x="-905" y="-84"><field name="msg">LEFT</field><statement name="DO"><block type="display_show_image" id="Z]QtQ,$~q[;X#Ik*s1ht"><value name="data"><shadow type="pins_builtinimg" id="bJ{UMYF_;wJ1J/jCtW8#"><field name="PIN">onboard_matrix.LEFT_ARROW</field></shadow></value></block></statement></block><block type="espnow_radio_recv_certain_msg_new" id="3Z=^l+aVQS(2:Zkh#};]" x="-904" y="13"><field name="msg">RIGHT</field><statement name="DO"><block type="display_show_image" id="?P1)Ukg[dUll[/C0L]od"><value name="data"><shadow type="pins_builtinimg" id="g.o4Mng7fb4LvnTXHb8T"><field name="PIN">onboard_matrix.RIGHT_ARROW</field></shadow></value></block></statement></block></xml><config>{}</config><code>aW1wb3J0IHJhZGlvCkVTUE5vd19yYWRpbz1yYWRpby5FU1BOb3coKQppbXBvcnQgbWl4Z29fY2MKaGFuZGxlX2xpc3Q9W10KaW1wb3J0IG1hY2hpbmUKZGVmIEVTUE5vd19yYWRpb19yZWN2KG1hYyxFU1BOb3dfcmFkaW9fbXNnKToKICAgIHByaW50KEVTUE5vd19yYWRpb19tc2cpCgppZiBub3QgRVNQTm93X3JhZGlvX3JlY3YgaW4gaGFuZGxlX2xpc3Q6CiAgICBoYW5kbGVfbGlzdC5hcHBlbmQoRVNQTm93X3JhZGlvX3JlY3YpCkVTUE5vd19yYWRpby5yZWN2X2NiKGhhbmRsZV9saXN0KQoKZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9tYXRyaXgKZGVmIEVTUE5vd19yYWRpb19yZWN2X19MRUZUKG1hYyxFU1BOb3dfcmFkaW9fbXNnKToKICAgIG9uYm9hcmRfbWF0cml4LnNob3dzKG9uYm9hcmRfbWF0cml4LkxFRlRfQVJST1cpCgppZiBub3QgRVNQTm93X3JhZGlvX3JlY3ZfX0xFRlQgaW4gaGFuZGxlX2xpc3Q6CiAgICBoYW5kbGVfbGlzdC5hcHBlbmQoRVNQTm93X3JhZGlvX3JlY3ZfX0xFRlQpCkVTUE5vd19yYWRpby5yZWN2X2NiKGhhbmRsZV9saXN0KQoKZGVmIEVTUE5vd19yYWRpb19yZWN2X19SSUdIVChtYWMsRVNQTm93X3JhZGlvX21zZyk6CiAgICBvbmJvYXJkX21hdHJpeC5zaG93cyhvbmJvYXJkX21hdHJpeC5SSUdIVF9BUlJPVykKCmlmIG5vdCBFU1BOb3dfcmFkaW9fcmVjdl9fUklHSFQgaW4gaGFuZGxlX2xpc3Q6CiAgICBoYW5kbGVfbGlzdC5hcHBlbmQoRVNQTm93X3JhZGlvX3JlY3ZfX1JJR0hUKQpFU1BOb3dfcmFkaW8ucmVjdl9jYihoYW5kbGVfbGlzdCkKCgoKRVNQTm93X3JhZGlvLnNldF9jaGFubmVsKGNoYW5uZWw9MTApCkVTUE5vd19yYWRpby5hY3RpdmUoVHJ1ZSkKd2hpbGUgVHJ1ZToKICAgIGlmIG1peGdvX2NjLkIxa2V5Lndhc19wcmVzc2VkKCk6CiAgICAgICAgRVNQTm93X3JhZGlvLnNlbmQoImZmZmZmZmZmZmZmZiIsJ0xFRlQnKQogICAgaWYgbWl4Z29fY2MuQjJrZXkud2FzX3ByZXNzZWQoKToKICAgICAgICBFU1BOb3dfcmFkaW8uc2VuZCgiZmZmZmZmZmZmZmZmIiwnUklHSFQnKQo=</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="variables_set" id="vQf1)(M09wVmp_]t1LwV" x="-557" y="-442"><field name="VAR">lastmsgtime</field><value name="VALUE"><block type="controls_millis" id=")X[~!4uis`R:+A**mm:y"><field name="Time">ms</field></block></value><next><block type="espnow_radio_channel" id="@U=#Yi^5rw#}s0[/pSDc"><value name="CHNL"><shadow type="espnow_channel" id="sJB6]YNko$y{/Z)M$@*b"><field name="PIN">10</field></shadow></value><next><block type="espnow_radio_on_off" id="0f:n.v1#79zUXoc$YsW#"><field name="on_off">True</field><next><block type="controls_whileUntil" id="5L.]umFA2Eas;k[!1sP6"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="dn?ROQ58upjh*7ICS8ER"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_delay_new" id="(J*mVPn8)PnUCt8/qJ@)"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="Q1+Bs#sCYL8sj8LdXs5D"><field name="NUM">2</field></shadow></value><next><block type="espnow_radio_send" id="M^pNimjq+wb7NEUo/QK#"><value name="send"><shadow type="text" id="9`=Bt?*NbONzQ{*a5D1x"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="eF3!{_fZM;-O/CN2q(.W"><value name="VAR"><shadow type="variables_get" id="rU#j1MU?9hAqY8_0bMKc"><field name="VAR">x</field></shadow><block type="controls_millis" id="Vqb?H?+s@4UldaFe1w]o"><field name="Time">ms</field></block></value></block></value><next><block type="controls_if" id="0Df!QQ[If6(w{[U*S_q5"><value name="IF0"><block type="logic_compare" id="RZ|$?EH=2Lxyc]_5RUQB"><field name="OP">GT</field><value name="A"><block type="math_arithmetic" id="N#fxX^T$3V-!}O`l^c*)"><field name="OP">MINUS</field><value name="A"><shadow type="math_number" id="g.J,!oN-]IlS+wa-:YxP"><field name="NUM">1</field></shadow><block type="controls_millis" id="d,l9c/n0E@^FHrBp1e;9"><field name="Time">ms</field></block></value><value name="B"><shadow type="math_number" id="rXGM,$o(Qj)m)!^U?A^Z"><field name="NUM">1</field></shadow><block type="variables_get" id="0_ZUh3kdJ4yVEBtB3[/A"><field name="VAR">lastmsgtime</field></block></value></block></value><value name="B"><block type="math_number" id="Rh0}K[rcdq:IPinYkT;{"><field name="NUM">10000</field></block></value></block></value><statement name="DO0"><block type="display_show_image" id="eAh:#;7fl$=a$uw#EPeb"><value name="data"><shadow type="pins_builtinimg" id="IG4T5A*v^^B5_`q:;{ak"><field name="PIN">onboard_matrix.NO</field></shadow></value><next><block type="esp32_onboard_music_play_list" id="r*~W-o,0R+m_bp$T/nT_"><value name="LIST"><shadow type="pins_playlist" id="!K7L,j_Hw[R:_N_bGChn"><field name="PIN">onboard_music.RINGTONE</field></shadow></value></block></next></block></statement></block></next></block></next></block></statement></block></next></block></next></block></next></block><block type="espnow_radio_recv_new" id="-*Gp^R?)Q]wb{uyTE[I$" x="-534" y="-34"><statement name="DO"><block type="variables_global" id="a82OD:w]GHn1,(T@w6Mr"><value name="VAR"><block type="variables_get" id="W3f)C.2?n5S+E3R7IR3L"><field name="VAR">lastmsgtime</field></block></value><next><block type="display_show_image" id="DPK~{M1u;9?DDr[K$)#X"><value name="data"><shadow type="pins_builtinimg" id="_av]yk06p8lI}KhAC~8u"><field name="PIN">onboard_matrix.YES</field></shadow></value><next><block type="variables_set" id=",HJ4?8VW:7Ls-XYspW^q"><field name="VAR">lastmsgtime</field><value name="VALUE"><block type="controls_millis" id="1Od5]y1-TVd+3@AMJU8^"><field name="Time">ms</field></block></value></block></next></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IHRpbWUKaW1wb3J0IHJhZGlvCkVTUE5vd19yYWRpbz1yYWRpby5FU1BOb3coKQpmcm9tIG1peGdvX2NjIGltcG9ydCBvbmJvYXJkX21hdHJpeApmcm9tIG1peGdvX2NjIGltcG9ydCBvbmJvYXJkX211c2ljCmhhbmRsZV9saXN0PVtdCmRlZiBFU1BOb3dfcmFkaW9fcmVjdihtYWMsRVNQTm93X3JhZGlvX21zZyk6CiAgICBnbG9iYWwgbGFzdG1zZ3RpbWUKICAgIG9uYm9hcmRfbWF0cml4LnNob3dzKG9uYm9hcmRfbWF0cml4LllFUykKICAgIGxhc3Rtc2d0aW1lID0gdGltZS50aWNrc19tcygpCgppZiBub3QgRVNQTm93X3JhZGlvX3JlY3YgaW4gaGFuZGxlX2xpc3Q6CiAgICBoYW5kbGVfbGlzdC5hcHBlbmQoRVNQTm93X3JhZGlvX3JlY3YpCkVTUE5vd19yYWRpby5yZWN2X2NiKGhhbmRsZV9saXN0KQoKCgpsYXN0bXNndGltZSA9IHRpbWUudGlja3NfbXMoKQpFU1BOb3dfcmFkaW8uc2V0X2NoYW5uZWwoY2hhbm5lbD0xMCkKRVNQTm93X3JhZGlvLmFjdGl2ZShUcnVlKQp3aGlsZSBUcnVlOgogICAgdGltZS5zbGVlcCgyKQogICAgRVNQTm93X3JhZGlvLnNlbmQoImZmZmZmZmZmZmZmZiIsc3RyKHRpbWUudGlja3NfbXMoKSkpCiAgICBpZiB0aW1lLnRpY2tzX21zKCkgLSBsYXN0bXNndGltZSA+IDEwMDAwOgogICAgICAgIG9uYm9hcmRfbWF0cml4LnNob3dzKG9uYm9hcmRfbWF0cml4Lk5PKQogICAgICAgIG9uYm9hcmRfbXVzaWMucGxheShvbmJvYXJkX211c2ljLlJJTkdUT05FKQo=</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

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="iot_wifi_connect" id="bsyaV),-4:t1/jKHJgRN" x="-1549" y="-410"><value name="WIFINAME"><shadow type="text" id=":zxCy/8X3_D(v@{5*:6s"><field name="TEXT">fuhua3</field></shadow></value><value name="PASSWORD"><shadow type="text" id="u5VMy]4.UM]kF7;Va]^L"><field name="TEXT">1234567890</field></shadow></value><next><block type="display_show_image_or_string_delay" id="z|J}**(Tp#/#KC+*7?nW"><field name="center">True</field><value name="data"><shadow type="text" id="ZWS#)4nM8nf;Q74gd~DY"><field name="TEXT">WO</field></shadow></value><value name="space"><shadow type="math_number" id="1qG|*DQD!6Or8JMFDgdT"><field name="NUM">0</field></shadow></value><next><block type="IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE" id="B@OJ#k=RZ.@e+8wPR8qZ"><value name="SERVER"><shadow type="text" id="Qy*}oI);QZ0PIq|m`ZZ~"><field name="TEXT">mixio.mixly.cn</field></shadow></value><value name="KEY"><shadow type="iot_mixly_key" id="IuU18s=XPQ~fYdor`IaJ"><field name="VISITOR_ID">31MOTCLJ</field></shadow></value><next><block type="display_show_image_or_string_delay" id="uTF2RTyya;4O05,[8Oro"><field name="center">True</field><value name="data"><shadow type="text" id="uEtVjkEc}.L@.;]Bp/lS"><field name="TEXT">MO</field></shadow></value><value name="space"><shadow type="math_number" id="vhZNH_:4qI.-R;;Gfz5]"><field name="NUM">0</field></shadow></value><next><block type="controls_whileUntil" id=".F).on(SQu6[vW|W!JzR"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="@]*l9VmkYh-ygpl]|xPN"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_delay_new" id="P@yIS4G-OEb_.8z@vxa5"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="eLKZn+fKdF`3P@`_~!1w"><field name="NUM">5</field></shadow></value><next><block type="IOT_MIXIO_PUBLISH" id=";T2_882#e7@B4E}P45hI"><value name="TOPIC"><shadow type="text" id="VT0pX)T/Qc1KZ@1mW8sm"><field name="TEXT">光照</field></shadow></value><value name="MSG"><shadow type="text" id="1:ZAf8{0+8!XctdhnaiX"><field name="TEXT">msg</field></shadow><block type="sensor_LTR308" id="mfznSNYMgN@@w]S`C^gA"></block></value><next><block type="display_scroll_string" id="U=YLA`gc!pvW5t@l3AMz"><value name="data"><shadow type="text" id=":NAo?_am5EeH_dB]jn8Y"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="g0-yt5eX,.}7[-j9{]TU"><value name="VAR"><shadow type="variables_get" id="@ni^?4~S6:Qu:.4a`hOl"><field name="VAR">x</field></shadow><block type="sensor_LTR308" id="}9]`F6LSt?6#=2/{[kVQ"></block></value></block></value></block></next></block></next></block></statement></block></next></block></next></block></next></block></next></block></xml><config>{}</config><code>aW1wb3J0IG1peGlvdApmcm9tIG1peGdvX2NjIGltcG9ydCBvbmJvYXJkX21hdHJpeAppbXBvcnQgbWFjaGluZQpmcm9tIHViaW5hc2NpaSBpbXBvcnQgaGV4bGlmeQppbXBvcnQgdGltZQpmcm9tIG1peGdvX2NjIGltcG9ydCBvbmJvYXJkX2FscwoKCm1peGlvdC53bGFuX2Nvbm5lY3QoJ2Z1aHVhMycsJzEyMzQ1Njc4OTAnKQpvbmJvYXJkX21hdHJpeC5zaG93cygnV08nLHNwYWNlID0gMCxjZW50ZXIgPSBUcnVlKQpNUVRUX1VTUl9QUkogPSAiTWl4SU8vMzFNT1RDTEovZGVmYXVsdC8iCm1xdHRfY2xpZW50ID0gbWl4aW90LmluaXRfTVFUVF9jbGllbnQoJ21peGlvLm1peGx5LmNuJywgIk1peElPX3B1YmxpYyIsICJNaXhJT19wdWJsaWMiLCBNUVRUX1VTUl9QUkopCm9uYm9hcmRfbWF0cml4LnNob3dzKCdNTycsc3BhY2UgPSAwLGNlbnRlciA9IFRydWUpCndoaWxlIFRydWU6CiAgICB0aW1lLnNsZWVwKDUpCiAgICBtcXR0X2NsaWVudC5wdWJsaXNoKE1RVFRfVVNSX1BSSiArICflhYnnhacnLCBvbmJvYXJkX2Fscy5hbHNfdmlzKCkpCiAgICBvbmJvYXJkX21hdHJpeC5zY3JvbGwoc3RyKG9uYm9hcmRfYWxzLmFsc192aXMoKSkpCg==</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="iot_wifi_connect" id="oB1w-`TwADt]bo4c#LMQ" x="-1378" y="-423"><value name="WIFINAME"><shadow type="text" id="WG-ssgVz@_W]YWgSUvCb"><field name="TEXT">fuhua3</field></shadow></value><value name="PASSWORD"><shadow type="text" id="pu824Rh^E]SXeAY.)z~_"><field name="TEXT">1234567890</field></shadow></value><next><block type="display_show_image_or_string_delay" id="dMQL?Q,xFzHv4C6Y[H25"><field name="center">True</field><value name="data"><shadow type="text" id="{i6CZl[fz9v,-iLZ$N+("><field name="TEXT">WO</field></shadow></value><value name="space"><shadow type="math_number" id="oFkq1d**TM_{A|g?OfAB"><field name="NUM">0</field></shadow></value><next><block type="IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE" id="R-!Q2~(6^ZaBdH:D+~Me"><value name="SERVER"><shadow type="text" id="qR#$_w^iqji2sQx2$m.{"><field name="TEXT">mixio.mixly.cn</field></shadow></value><value name="KEY"><shadow type="iot_mixly_key" id="yuJ+p8DSmkc64d?f[*]p"><field name="VISITOR_ID">4OG7811O</field></shadow></value><next><block type="display_show_image_or_string_delay" id="7ICo85u2U|Hih!7!Pv:@"><field name="center">True</field><value name="data"><shadow type="text" id="z,p7TY3HU@KgsjBLV74l"><field name="TEXT">MO</field></shadow></value><value name="space"><shadow type="math_number" id="EY6fn,Y5wfWogTKj^QuP"><field name="NUM">0</field></shadow></value><next><block type="controls_whileUntil" id="E6,]kxHYs?/?*V3Wf_nx"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="ke20K@-JTl;xg3ezSk?l"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_delay_new" id="Ei1jts]_@q3963*1]_ef"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="!8Y)!s_0TNt=+A1;N*^0"><field name="NUM">5</field></shadow></value><next><block type="IOT_MIXIO_PUBLISH" id="oN$JK`D-o}!4Ae5vKu5R"><value name="TOPIC"><shadow type="text" id="Aiv5kNX{pq/yGl0l+K+z"><field name="TEXT">环境</field></shadow></value><value name="MSG"><shadow type="text" id="M^BS,8OX$?XBeiE8t0]V"><field name="TEXT">msg</field></shadow><block type="IOT_FORMAT_STRING" id="`|+:m/`jCeGlK*IIN#fI"><value name="VAR"><block type="dicts_create_with_noreturn" id="6pP7HIM1A7A3vlvPUJr/" 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_light" id="bs@T3:w9$b~@n?;[}6?M"></block></value><value name="ADD1"><block type="sensor_sound" id="=RbM.u.RD;t]`Eb]7:Ky"></block></value><value name="ADD2"><block type="sensor_get_acceleration" id="YqqNY8bk.!F,Mo-hS3t("><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>aW1wb3J0IG1peGlvdApmcm9tIG1peGdvX2NjIGltcG9ydCBvbmJvYXJkX21hdHJpeAppbXBvcnQgbWFjaGluZQpmcm9tIHViaW5hc2NpaSBpbXBvcnQgaGV4bGlmeQppbXBvcnQgdGltZQppbXBvcnQgbWl4cHkKZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9hbHMKZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9zb3VuZApmcm9tIG1peGdvX2NjIGltcG9ydCBvbmJvYXJkX2FjYwoKCm1peGlvdC53bGFuX2Nvbm5lY3QoJ2Z1aHVhMycsJzEyMzQ1Njc4OTAnKQpvbmJvYXJkX21hdHJpeC5zaG93cygnV08nLHNwYWNlID0gMCxjZW50ZXIgPSBUcnVlKQpNUVRUX1VTUl9QUkogPSAiTWl4SU8vNE9HNzgxMU8vZGVmYXVsdC8iCm1xdHRfY2xpZW50ID0gbWl4aW90LmluaXRfTVFUVF9jbGllbnQoJ21peGlvLm1peGx5LmNuJywgIk1peElPX3B1YmxpYyIsICJNaXhJT19wdWJsaWMiLCBNUVRUX1VTUl9QUkopCm9uYm9hcmRfbWF0cml4LnNob3dzKCdNTycsc3BhY2UgPSAwLGNlbnRlciA9IFRydWUpCndoaWxlIFRydWU6CiAgICB0aW1lLnNsZWVwKDUpCiAgICBtcXR0X2NsaWVudC5wdWJsaXNoKE1RVFRfVVNSX1BSSiArICfnjq/looMnLCBtaXhweS5mb3JtYXRfc3RyKHsi5YWJ54WnIjpvbmJvYXJkX2Fscy5hbHNfdmlzKCksICLlo7Dpn7MiOm9uYm9hcmRfc291bmQucmVhZCgpLCAi6ZyH5YqoIjpvbmJvYXJkX2FjYy5zdHJlbmd0aCgpfSkpCg==</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><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="lb/uJ0Acu[8r!J8z*B7k" x="-2026" y="-593"><value name="WIFINAME"><shadow type="text" id=";D/R4;?RFFe8ICCcfJ~q"><field name="TEXT">fuhua3</field></shadow></value><value name="PASSWORD"><shadow type="text" id="x5UE{)8H`oF7dqdlYVoJ"><field name="TEXT">1234567890</field></shadow></value><next><block type="display_show_image_or_string_delay" id="l,QNRm6p[LpL1hN/4/-A"><field name="center">True</field><value name="data"><shadow type="text" id="+;Dy/2,8$?F):r;_5TD3"><field name="TEXT">WO</field></shadow></value><value name="space"><shadow type="math_number" id="9v3lwyJK!S}a-P{98OEs"><field name="NUM">0</field></shadow></value><next><block type="IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE" id="2W3(gRaVi[UdIkIc[lgJ"><value name="SERVER"><shadow type="text" id=":}Z*Wo0!CPKk(-9c^B|-"><field name="TEXT">mixio.mixly.cn</field></shadow></value><value name="KEY"><shadow type="iot_mixly_key" id="3^w~[Wri$B2=yr5=*sv?"><field name="VISITOR_ID">31MOTCLJ</field></shadow></value><next><block type="display_show_image_or_string_delay" id="N^5y7,oF8SV]C..pB{Ho"><field name="center">True</field><value name="data"><shadow type="text" id="~t56a:q5Up)GK{ZY~^1S"><field name="TEXT">MO</field></shadow></value><value name="space"><shadow type="math_number" id="0Ast!3n@zW?^V:60Yb@["><field name="NUM">0</field></shadow></value><next><block type="IOT_MIXIO_SUBSCRIBE" id="QolgJ7ZUxYvd4tODp.5X"><value name="TOPIC"><shadow type="text" id="Xu8y$Qm{xksUw)8;U(DZ"><field name="TEXT">亮屏</field></shadow></value><value name="METHOD"><shadow type="factory_block_return" id="q7yDP!mQAt30!Yh4kj:]"><field name="VALUE">method</field></shadow></value><next><block type="controls_whileUntil" id="GyM:TophJ5v!Knv$JLnR"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="d5?GP{q]ArI^Z2rMPyV@"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="iot_mixio_check" id="Ok1xmy1Ih/bMqNdJc-|U"></block></statement></block></next></block></next></block></next></block></next></block></next></block><block type="procedures_defnoreturn" id="8*A89,ImI@QgK0|AO91h" 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="e8-7PXz~Ja6)rl$|,!A;"><value name="IF0"><block type="logic_compare" id="YE,uU!S:O|cLwc=H1T~B"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="7fPFq@WMiY/`,~uUCG.:"><field name="VAR">msg</field></block></value><value name="B"><block type="text" id="gHLw3x2v^uSa11F[uHf8"><field name="TEXT">1</field></block></value></block></value><statement name="DO0"><block type="display_show_image" id="Uf?Pw/mD`R4Y:jfrFO){"><value name="data"><shadow type="pins_builtinimg" id="su?s5Ymx@)H*A!t:y/ee"><field name="PIN">onboard_matrix.HEART</field></shadow></value></block></statement><next><block type="controls_if" id="H{jXzEm,hAu!Sp#L/Wp3"><value name="IF0"><block type="logic_compare" id=",5k^(BxJ#cBhpvt+Nc0`"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="goXKqmU6DNnPJ-+i$Q],"><field name="VAR">msg</field></block></value><value name="B"><block type="text" id="qqH`9jQmL3w6xy_Mx:V8"><field name="TEXT">0</field></block></value></block></value><statement name="DO0"><block type="display_clear" id="7b^V!2)$0vf]m.Af,okq"></block></statement></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1peGlvdApmcm9tIG1peGdvX2NjIGltcG9ydCBvbmJvYXJkX21hdHJpeAppbXBvcnQgbWFjaGluZQpmcm9tIHViaW5hc2NpaSBpbXBvcnQgaGV4bGlmeQoKZGVmIG1ldGhvZChjbGllbnQsIHRvcGljLCBtc2cpOgogICAgaWYgbXNnID09ICcxJzoKICAgICAgICBvbmJvYXJkX21hdHJpeC5zaG93cyhvbmJvYXJkX21hdHJpeC5IRUFSVCkKICAgIGlmIG1zZyA9PSAnMCc6CiAgICAgICAgb25ib2FyZF9tYXRyaXguZmlsbCgwKQogICAgICAgIG9uYm9hcmRfbWF0cml4LnNob3coKQoKCgptaXhpb3Qud2xhbl9jb25uZWN0KCdmdWh1YTMnLCcxMjM0NTY3ODkwJykKb25ib2FyZF9tYXRyaXguc2hvd3MoJ1dPJyxzcGFjZSA9IDAsY2VudGVyID0gVHJ1ZSkKTVFUVF9VU1JfUFJKID0gIk1peElPLzMxTU9UQ0xKL2RlZmF1bHQvIgptcXR0X2NsaWVudCA9IG1peGlvdC5pbml0X01RVFRfY2xpZW50KCdtaXhpby5taXhseS5jbicsICJNaXhJT19wdWJsaWMiLCAiTWl4SU9fcHVibGljIiwgTVFUVF9VU1JfUFJKKQpvbmJvYXJkX21hdHJpeC5zaG93cygnTU8nLHNwYWNlID0gMCxjZW50ZXIgPSBUcnVlKQptcXR0X2NsaWVudC5zZXRfY2FsbGJhY2soJ+S6ruWxjycsbWV0aG9kLCBNUVRUX1VTUl9QUkopCm1xdHRfY2xpZW50LnN1YnNjcmliZShNUVRUX1VTUl9QUkogKyAn5Lqu5bGPJykKd2hpbGUgVHJ1ZToKICAgIG1xdHRfY2xpZW50LmNoZWNrX21zZygpCg==</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 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="variables_set" id="Mld4.XlYwt`s3t5,X{[+" x="-2139" y="-747"><field name="VAR">本机用户</field><value name="VALUE"><block type="text" id="#T|,ZE_^@KtpE(u_Y$iD"><field name="TEXT">mixly</field></block></value><next><block type="iot_wifi_connect" id="W6p`!FnIX]o+t*s~J-~$"><value name="WIFINAME"><shadow type="text" id="$:PZJtlZG(m]nCh+z3s}"><field name="TEXT">fuhua3</field></shadow></value><value name="PASSWORD"><shadow type="text" id=".(5rA~Fuu(*Vf^5O2+s("><field name="TEXT">1234567890</field></shadow></value><next><block type="IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE" id="x{W$iQZTNHxC~.C,V/I("><value name="SERVER"><shadow type="text" id="5NPgRyLmAF1u0d`pQh+P"><field name="TEXT">mixio.mixly.cn</field></shadow></value><value name="KEY"><shadow type="factory_block_return" id="LzaqwO~aUdSXCj:WO1sR"><field name="VALUE">7b6443</field></shadow></value><next><block type="controls_whileUntil" id="jYHqd=N{DIOtOnDgg**A"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="K4!/l,1aM_ysrgG`idk,"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="display_show_image_or_string_delay" id="B[_JdTS4HrI*QoG).hCN"><field name="center">True</field><value name="data"><shadow type="text" id="wJV9wc9=?@@[!0rbWk[("><field name="TEXT">GO</field></shadow></value><value name="space"><shadow type="math_number" id="=LaouSPYIkcI4-M9f3s*"><field name="NUM">0</field></shadow></value><next><block type="controls_if" id="m+3o)$/NiUE}NvTS#:19"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="6-DzX~.JtflKhQQ{y1Nj"><value name="btn"><shadow type="pins_button" id="4WfLqOzy`}Cb]jvTQ/dW"><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO0"><block type="display_clear" id="-[yb6Z!}/7c0|)6Om0c{"><next><block type="IOT_MIXIO_PUBLISH" id="`=3.mGUi{;Z2$c+J2Y/*"><value name="TOPIC"><shadow type="text" id="cafe1l#9M5OXJQFHra(P"><field name="TEXT">姓名</field></shadow></value><value name="MSG"><shadow type="text" id="!W9IdZJIcdYzs4/y__cH"><field name="TEXT">msg</field></shadow><block type="variables_get" id="7ynaI,un,jhUOOTtPsWS"><field name="VAR">本机用户</field></block></value><next><block type="display_scroll_string" id="sigs5(ykntw#+@cX.]S;"><value name="data"><shadow type="text" id="ol~n($,z~!gcYV*$lrb7"><field name="TEXT">Mixly</field></shadow><block type="variables_get" id=")Ct4EcNqcbB)tvB3vZIx"><field name="VAR">本机用户</field></block></value><next><block type="display_show_image_or_string_delay" id="a$=ydnc*vlk(TWs=ozy]"><field name="center">True</field><value name="data"><shadow type="text" id="To8ZG#B2L?Yh1En(CP!/"><field name="TEXT">OK</field></shadow></value><value name="space"><shadow type="math_number" id=";aM^yg~LFMxiVD`XvH.x"><field name="NUM">0</field></shadow></value><next><block type="controls_delay_new" id="J}t!9^V2tESCS5j7|kCG"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="O}O0Nu9pr!9/7zkaTMcM"><field name="NUM">1</field></shadow></value><next><block type="display_show_image_or_string_delay" id="M7u]SnLnPeKB.Hm=RFsJ"><field name="center">True</field><value name="data"><shadow type="text" id="^$+Ich[c/HsCr5`0nvx@"><field name="TEXT">GO</field></shadow></value><value name="space"><shadow type="math_number" id="oV=B05Peo:apP~xb`{Eo"><field name="NUM">0</field></shadow></value></block></next></block></next></block></next></block></next></block></next></block></statement></block></next></block></statement></block></next></block></next></block></next></block></xml><config>{}</config><code>aW1wb3J0IG1peGlvdAppbXBvcnQgbWFjaGluZQppbXBvcnQgdXJlcXVlc3RzCmZyb20gdWJpbmFzY2lpIGltcG9ydCBoZXhsaWZ5CmZyb20gbWl4cHkgaW1wb3J0IGFuYWx5c2Vfc2hhcmVrZXkKZnJvbSBtaXhnb19jYyBpbXBvcnQgb25ib2FyZF9tYXRyaXgKaW1wb3J0IG1peGdvX2NjCmltcG9ydCB0aW1lCgoKX0U2XzlDX0FDX0U2XzlDX0JBX0U3Xzk0X0E4X0U2Xzg4X0I3ID0gJ21peGx5JwptaXhpb3Qud2xhbl9jb25uZWN0KCdmdWh1YTMnLCcxMjM0NTY3ODkwJykKc2sgPSBhbmFseXNlX3NoYXJla2V5KCdodHRwOi8vbWl4aW8ubWl4bHkuY24vbWl4aW8tcGhwL3NoYXJla2V5LnBocD9zaz03YjY0NDMnKQpNUVRUX1VTUl9QUkogPSBza1swXSsnLycrc2tbMV0rJy8nCm1xdHRfY2xpZW50ID0gbWl4aW90LmluaXRfTVFUVF9jbGllbnQoJ21peGlvLm1peGx5LmNuJywgc2tbMF0sIHNrWzJdLCBNUVRUX1VTUl9QUkopCndoaWxlIFRydWU6CiAgICBvbmJvYXJkX21hdHJpeC5zaG93cygnR08nLHNwYWNlID0gMCxjZW50ZXIgPSBUcnVlKQogICAgaWYgbWl4Z29fY2MuQjFrZXkud2FzX3ByZXNzZWQoKToKICAgICAgICBvbmJvYXJkX21hdHJpeC5maWxsKDApCiAgICAgICAgb25ib2FyZF9tYXRyaXguc2hvdygpCiAgICAgICAgbXF0dF9jbGllbnQucHVibGlzaChNUVRUX1VTUl9QUkogKyAn5aeT5ZCNJywgX0U2XzlDX0FDX0U2XzlDX0JBX0U3Xzk0X0E4X0U2Xzg4X0I3KQogICAgICAgIG9uYm9hcmRfbWF0cml4LnNjcm9sbChfRTZfOUNfQUNfRTZfOUNfQkFfRTdfOTRfQThfRTZfODhfQjcpCiAgICAgICAgb25ib2FyZF9tYXRyaXguc2hvd3MoJ09LJyxzcGFjZSA9IDAsY2VudGVyID0gVHJ1ZSkKICAgICAgICB0aW1lLnNsZWVwKDEpCiAgICAgICAgb25ib2FyZF9tYXRyaXguc2hvd3MoJ0dPJyxzcGFjZSA9IDAsY2VudGVyID0gVHJ1ZSkK</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 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="system_print" id="Us_S,{V1}*EF^cZwYL6Y" x="-1455" y="-727"><value name="VAR"><shadow type="text" id="ncp0y*z1L~2gHC!O66xz"><field name="TEXT">Mixly</field></shadow><block type="storage_list_all_files" id=")fY25VX((m}~)?jmR,Pg"></block></value><next><block type="system_print" id="fxWXC4Tg=ZtZzm~pS:Qu"><value name="VAR"><shadow type="text" id="]}wD;kx}VhzGSiOq-:9X"><field name="TEXT">Mixly</field></shadow><block type="storage_get_current_dir" id="u*0xeD!#JN@qCQ[3k`Iw"></block></value><next><block type="variables_set" id="=j,orXhE5g3_E8[AXUsi"><field name="VAR">s</field><value name="VALUE"><block type="storage_list_all_files" id="pX3c#mE]}e}E~PnA7sG{"></block></value><next><block type="controls_forEach" id="$,0CLl+$;ZE.xm.e;gt6"><value name="LIST"><shadow type="list_many_input" id="bt5u}T*5l~`D/0m1Efvy"><field name="CONTENT">0,1,2,3</field></shadow><block type="controls_range" id="w$pW1$XlEjVCUV6519sd"><value name="FROM"><shadow type="math_number" id="oQcZm)0+VWNb8or$G)pY"><field name="NUM">0</field></shadow></value><value name="TO"><shadow type="math_number" id="9F!CtJF$Cg`XK+edC(}I"><field name="NUM">5</field></shadow><block type="list_trig" id="#kuA^*.M~`n=3?[F+sp*"><field name="OP">LEN</field><value name="data"><shadow type="variables_get" id="AsvERL*kQ!:1usKky+6O"><field name="VAR">s</field></shadow></value></block></value><value name="STEP"><shadow type="math_number" id="37BMDzh;dV3hr49g(PT]"><field name="NUM">1</field></shadow></value></block></value><value name="VAR"><shadow type="variables_get" id="_yMY$gto.tEPMzgr(LC["><field name="VAR">i</field></shadow></value><statement name="DO"><block type="system_print" id="xOhyX$#lv2sn?Q08=RiQ"><value name="VAR"><shadow type="text" id="SE_@b:+Zb1./Ie^RyZ3H"><field name="TEXT">Mixly</field></shadow><block type="lists_get_index" id="FmXGvWPiNde!D?YpHO|7"><value name="LIST"><shadow type="variables_get" id="3U;7jkfW9VYg$JY~0+sZ"><field name="VAR">s</field></shadow></value><value name="AT"><shadow type="math_number" id="ZeR9]sTWUkvS0IJqejkL"><field name="NUM">0</field></shadow><block type="variables_get" id="]27TWWSqO~~ap1_{f!dp"><field name="VAR">i</field></block></value></block></value></block></statement></block></next></block></next></block></next></block></xml><config>{}</config><code>aW1wb3J0IG1hY2hpbmUKaW1wb3J0IG9zCmltcG9ydCBtYXRoCgoKcHJpbnQob3MubGlzdGRpcigpKQpwcmludChvcy5nZXRjd2QoKSkKcyA9IG9zLmxpc3RkaXIoKQpmb3IgaSBpbiByYW5nZSgwLCBsZW4ocyksIDEpOgogICAgcHJpbnQoc1tpXSkK</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="system_print" id="N1X!SCF!cw*!_wIY-reA" x="-1372" y="-566"><value name="VAR"><shadow type="text" id="OO8M]`g@!,E5k`,iH=dS"><field name="TEXT">Mixly</field></shadow><block type="storage_list_all_files" id="!,!5^0.Dg#4iqe*P;p3?"></block></value><next><block type="system_print" id="Xz$Uw`~N2Rt=$[zhaq4Q"><value name="VAR"><shadow type="text" id="YF|b,{=hd^ouGG!IVy5$"><field name="TEXT">Mixly</field></shadow><block type="storage_get_current_dir" id="McbCY(`rbN;XXSNtoB8J"></block></value><next><block type="variables_set" id="ie)~yWk^@V(}_U|lwFS+"><field name="VAR">s</field><value name="VALUE"><block type="storage_list_all_files" id=":PNQ~1mwu/.8Rx$A9[;Q"></block></value><next><block type="controls_forEach" id="]KioL8!:sm~J$o,3ta[("><value name="LIST"><shadow type="list_many_input" id="l@dGIi(^]]:Tn7+K?H-U"><field name="CONTENT">0,1,2,3</field></shadow><block type="controls_range" id="X:oLcWQ{6(ty@YR0oj$y"><value name="FROM"><shadow type="math_number" id=";RFKjNz[BAgh7WSikSn1"><field name="NUM">0</field></shadow></value><value name="TO"><shadow type="math_number" id="!RsGUomCAYUz33z21Ce7"><field name="NUM">5</field></shadow><block type="list_trig" id="h*0.~VB_f5HL6+o!F{H$"><field name="OP">LEN</field><value name="data"><shadow type="variables_get" id="OWhGLo2N@a6Hx?j]qA?Q"><field name="VAR">s</field></shadow></value></block></value><value name="STEP"><shadow type="math_number" id="WsQZGl*@yT+[`hS!EKR1"><field name="NUM">1</field></shadow></value></block></value><value name="VAR"><shadow type="variables_get" id="}tGn/Bt/hZUs8ZS..A(0"><field name="VAR">i</field></shadow></value><statement name="DO"><block type="display_scroll_string" id="Gi]@Tm/e8OpyEYkKx=y!"><value name="data"><shadow type="text" id="1V3WXXz5/3opr}Y(*x=Z"><field name="TEXT">Mixly</field></shadow><block type="lists_get_index" id="m)jAkF-uI#2W`;4+^E8E"><value name="LIST"><shadow type="variables_get" id="4Xd__SN{Shb2c?!N(Fh/"><field name="VAR">s</field></shadow></value><value name="AT"><shadow type="math_number" id=":~!Xh)C}=I/p|1_g2Zv4"><field name="NUM">0</field></shadow><block type="variables_get" id="{`EYa:~fOIQ,EBRi:{5Z"><field name="VAR">i</field></block></value></block></value></block></statement></block></next></block></next></block></next></block></xml><config>{}</config><code>aW1wb3J0IG1hY2hpbmUKaW1wb3J0IG9zCmltcG9ydCBtYXRoCmZyb20gbWl4Z29fY2MgaW1wb3J0IG9uYm9hcmRfbWF0cml4CgoKcHJpbnQob3MubGlzdGRpcigpKQpwcmludChvcy5nZXRjd2QoKSkKcyA9IG9zLmxpc3RkaXIoKQpmb3IgaSBpbiByYW5nZSgwLCBsZW4ocyksIDEpOgogICAgb25ib2FyZF9tYXRyaXguc2Nyb2xsKHNbaV0pCg==</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="storage_fileopen" id="f@[~VE1]Z`K$`9BlG@|9" x="-1749" y="-505"><field name="MODE">w</field><value name="FILENAME"><shadow type="text" id="_D3|E/`Sb]oP6HI_2Awf"><field name="TEXT">test.txt</field></shadow></value><value name="FILE"><shadow type="variables_get" id="vsb}PE6aW#@#!9Rgvs,k"><field name="VAR">f</field></shadow></value><next><block type="controls_forEach" id="#zF;:UwBJ|P!Yf;lQKU-"><value name="LIST"><shadow type="list_many_input" id="=hm9oV:st,?*D})Lr0IE"><field name="CONTENT">0,1,2,3</field></shadow><block type="controls_range" id="_Zt4;+d}EwEk}ik]nR0!"><value name="FROM"><shadow type="math_number" id="Roi-WRBKUm(_Y_JmF|u1"><field name="NUM">0</field></shadow></value><value name="TO"><shadow type="math_number" id="aP_C7r$[Y5NKJ(2v?(xV"><field name="NUM">100</field></shadow></value><value name="STEP"><shadow type="math_number" id="eq{3a$1$pJQe,QH(A?/Q"><field name="NUM">1</field></shadow></value></block></value><value name="VAR"><shadow type="variables_get" id="Zc5k6;Jn-Do)chNV0udL"><field name="VAR">i</field></shadow></value><statement name="DO"><block type="storage_file_write" id="xRb38C4Ce=~nM~;TV{ED"><value name="data"><shadow type="text" id="SUE2b*h,noizF;;U.:b."><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id="QW^=8?nNcN)q~er26@#)"><value name="VAR"><shadow type="variables_get" id="Dxe2=VJYtH_96#Z-N*-#"><field name="VAR">x</field></shadow><block type="variables_get" id="2q$ksh?:l_88C)wAT)=K"><field name="VAR">i</field></block></value></block></value><value name="FILE"><shadow type="variables_get" id="D6$B${oURMR7?3j[ljlN"><field name="VAR">f</field></shadow></value><next><block type="storage_file_write" id="ppwWZr!k-1R2GRjmog?o"><value name="data"><shadow type="text" id="(Lqh@Z942=6@a8~3_Pd|"><field name="TEXT">Mixly</field></shadow><block type="ascii_to_char" id="HT^pNckHDB:2M`m,Arax"><value name="VAR"><shadow type="math_number" id="~o9Wfa!Bc9D(7O-W`Fr$"><field name="NUM">13</field></shadow></value></block></value><value name="FILE"><shadow type="variables_get" id="Rg-GRd]*aiS7)iJA|eL;"><field name="VAR">f</field></shadow></value></block></next></block></statement><next><block type="storage_close_file" id="Gus8|q9Q;,?f9f)|I|7!"><value name="FILE"><shadow type="variables_get" id="hHpp!+xCG~QG$,UGZ=SO"><field name="VAR">f</field></shadow></value><next><block type="storage_fileopen" id="L;=5=/|_VH/A_ppKdFPs"><field name="MODE">r</field><value name="FILENAME"><shadow type="text" id="GEoJX;oiOqtG}!u1F.*`"><field name="TEXT">test.txt</field></shadow></value><value name="FILE"><shadow type="variables_get" id="FnLAOo/X~hZ2ZYM:h$*1"><field name="VAR">f</field></shadow></value><next><block type="variables_set" id="VS,vD]TQV9h1pLx#m@$K"><field name="VAR">s</field><value name="VALUE"><block type="storage_get_contents_without_para" id="{2Q8hk6{mCNv]1EkCKor"><field name="MODE">readline</field><value name="FILE"><shadow type="variables_get" id="bn}8OQ5C,eCC=iyDuFZ!"><field name="VAR">f</field></shadow></value></block></value><next><block type="controls_whileUntil" id="zJfAl{-wP}FR]J`5.!;O"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="A!UT2NR6R;l*i|WMLZ,B"><field name="BOOL">TRUE</field></shadow><block type="variables_get" id="fx?xB5hl_~?ml9SlYf=y"><field name="VAR">s</field></block></value><statement name="DO"><block type="system_print_inline" id="U-FFw)JAeVQ{VJ}@tNY$"><value name="VAR"><shadow type="text" id="ceiPk:)P+L4urRU*x}i{"><field name="TEXT">Mixly</field></shadow><block type="variables_get" id="}@V5=nw?dB[$D[8f)i-)"><field name="VAR">s</field></block></value><next><block type="variables_set" id="A56:.X(zLx/-)Z8-jhcE"><field name="VAR">s</field><value name="VALUE"><block type="storage_get_contents_without_para" id="9e{XGYh@z@h/Ov;}!ID["><field name="MODE">readline</field><value name="FILE"><shadow type="variables_get" id="?ZJT93u;YCZ-D#Yr@vo6"><field name="VAR">f</field></shadow></value></block></value></block></next></block></statement><next><block type="storage_close_file" id="ZU#1KNQrQZIMlW+#~#;M"><value name="FILE"><shadow type="variables_get" id="1A.|r7rZ9.([*xc/jaAG"><field name="VAR">f</field></shadow></value></block></next></block></next></block></next></block></next></block></next></block></next></block></xml><config>{}</config><code>aW1wb3J0IG1hY2hpbmUKCgpmID0gb3BlbigndGVzdC50eHQnLCAndycpCmZvciBpIGluIHJhbmdlKDAsIDEwMCwgMSk6CiAgICBmLndyaXRlKHN0cihpKSkKICAgIGYud3JpdGUoY2hyKDEzKSkKZi5jbG9zZSgpCmYgPSBvcGVuKCd0ZXN0LnR4dCcsICdyJykKcyA9IGYucmVhZGxpbmUoKQp3aGlsZSBzOgogICAgcHJpbnQocyxlbmQgPSIiKQogICAgcyA9IGYucmVhZGxpbmUoKQpmLmNsb3NlKCkK</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 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="controls_whileUntil" id="=s08frr!0zh!Vay6mELP" x="-1793" y="-680"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="q2T$.VZK5R(Fgx}~Q!lZ"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="ce_go_stepper_keep" id="DMQZ1wfaPqq6G2g)odDz"><field name="VAR">F</field><value name="speed"><shadow type="math_number" id="Ui!jga6olCenv1A]5^`Y"><field name="NUM">100</field></shadow></value><next><block type="controls_delay_new" id="kMFDH4SCv$yqO?L]:bF."><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="Bw(7GYBB$7Cj[IDx|o)u"><field name="NUM">1</field></shadow></value><next><block type="ce_go_stepper_keep" id="a,/SX!7Tpi829xk/-7Cs"><field name="VAR">L</field><value name="speed"><shadow type="math_number" id="yv2AYXWp3qG*4Int2phZ"><field name="NUM">100</field></shadow></value><next><block type="controls_delay_new" id="g6-]#UVw~a/DdlTNH+|I"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id=";/Pho_s`fUr_)K=9/sMe"><field name="NUM">1</field></shadow></value></block></next></block></next></block></next></block></statement></block></xml><config>{}</config><code>ZnJvbSBtZV9nbyBpbXBvcnQgY2FyCmltcG9ydCB0aW1lCgoKd2hpbGUgVHJ1ZToKICAgIGNhci5tb3ZlKCJGIiwxMDApCiAgICB0aW1lLnNsZWVwKDEpCiAgICBjYXIubW92ZSgiTCIsMTAwKQogICAgdGltZS5zbGVlcCgxKQo=</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo ME"><block type="ce_go_dc_motor" id="pxLp~Za@7]4/{/Y,dUh~" x="-573" y="-219"><field name="wheel">0</field><field name="direction">CW</field><value name="speed"><shadow type="math_number" id="1[?6MQov$uTj8=fxHbUn"><field name="NUM">100</field></shadow></value><next><block type="ce_go_dc_motor" id="1Eu@WK/k=mS|]fn3p-!G"><field name="wheel">1</field><field name="direction">CW</field><value name="speed"><shadow type="math_number" id="8RZgO#12q:B]AJA19H2q"><field name="NUM">40</field></shadow></value><next><block type="controls_whileUntil" id="09b4Lze.Jd6S(S`-adpZ"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="c*)Qpl);xV}~]r7R[EE/"><field name="BOOL">TRUE</field></shadow></value></block></next></block></next></block></xml><config>{}</config><code>ZnJvbSBtZV9nbyBpbXBvcnQgY2FyCgoKY2FyLm1vdG9yKGNhci5NT1RPWzBdLCJDQ1ciLDEwMCkKY2FyLm1vdG9yKGNhci5NT1RPWzFdLCJDVyIsNDApCndoaWxlIFRydWU6CiAgICBwYXNzCg==</code>

View File

@@ -0,0 +1 @@
<xml version="Mixly 2.0 rc4" board="Python ESP32-C3@MixGo CC"><block type="ce_go_pin_near_state_change" id="S7X|EZ0M7GS--NF_Iu;F" x="-1749" y="-598"><field name="key">AS</field><next><block type="controls_whileUntil" id="_Wqp?~S@;o23Fr7BL5TG"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="@4g5.:EWwX^QF#H9/Ifz"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="ce_go_stepper_keep" id="v4G{$t0Ixj.2]q[7Pm.9"><field name="VAR">F</field><value name="speed"><shadow type="math_number" id="lb}elbBP}FY/4d3PLXrq"><field name="NUM">100</field></shadow></value><next><block type="controls_if" id="En9CYRDT#Ut.ilsc$*@,"><value name="IF0"><block type="logic_compare" id="vcdOZ4L|7jx`,iqf:Mm6"><field name="OP">GT</field><value name="A"><block type="ce_go_pin_near" id="wle0}|+LVjn0w3|}Cxq."><field name="key">[0]</field></block></value><value name="B"><block type="math_number" id="{Et9F;_$[af`q2iOr)rj"><field name="NUM">10000</field></block></value></block></value><statement name="DO0"><block type="ce_go_stepper_keep" id=".d^[y}_wIfk=1!K]Gz5:"><field name="VAR">B</field><value name="speed"><shadow type="math_number" id="cku6nd!MOd!?mABtWnm?"><field name="NUM">100</field></shadow></value><next><block type="controls_delay_new" id="PaldU^)zU{hB}pkoZ|z("><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="5NG)EhiBJc.MjXZHWE)O"><field name="NUM">1</field></shadow></value><next><block type="ce_go_stepper_keep" id="H-}XI#|^)c8cI!``UFS["><field name="VAR">R</field><value name="speed"><shadow type="math_number" id="!0|}q08sDT4V2UvR[LG5"><field name="NUM">100</field></shadow></value><next><block type="controls_delay_new" id=":DBULKlpWP]Ex*.JO5Ar"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="4}7^$mA9IZAtJ7f)vB.)"><field name="NUM">0.2</field></shadow></value></block></next></block></next></block></next></block></statement><next><block type="controls_if" id="6EAIgxDoX4d.8!nH0{{m"><value name="IF0"><block type="logic_compare" id=".xVUy8W(^d2H}Z!G?M)j"><field name="OP">GT</field><value name="A"><block type="ce_go_pin_near" id="eV;3y^@VFua+|Qn5s;Xl"><field name="key">[1]</field></block></value><value name="B"><block type="math_number" id="Se4Tx,:flFCB?nwo0V]^"><field name="NUM">10000</field></block></value></block></value><statement name="DO0"><block type="ce_go_stepper_keep" id="el}?p$Uya*{^M8a7Zuf@"><field name="VAR">B</field><value name="speed"><shadow type="math_number" id="3++Y9#M!!L1=WkdjcN)o"><field name="NUM">100</field></shadow></value><next><block type="controls_delay_new" id="(o+LTYb@9cOJkx3VXu(A"><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="$`=Xf`v3gEwO0:et_z)$"><field name="NUM">1</field></shadow></value><next><block type="ce_go_stepper_keep" id="Q8c;MWetQVz6m@er,!^U"><field name="VAR">L</field><value name="speed"><shadow type="math_number" id="MaGjPmgK}YOB`t)~MuNT"><field name="NUM">100</field></shadow></value><next><block type="controls_delay_new" id="3l6.BP;7gD)lre.lhf0["><field name="Time">s</field><value name="DELAY_TIME"><shadow type="math_number" id="Iy)z?,@0EDlORuQR:;_C"><field name="NUM">0.2</field></shadow></value></block></next></block></next></block></next></block></statement></block></next></block></next></block></statement></block></next></block><block type="logic_compare" id="vh*+^Am^.RvG==6?r(=q" x="-1618" y="-228"><field name="OP">LT</field><value name="B"><block type="math_number" id="1DbZmvGWJ!,9kV8)ii(n"><field name="NUM">50</field></block></value></block></xml><config>{}</config><code>ZnJvbSBtZV9nbyBpbXBvcnQgY2FyCmZyb20gbWVfZ28gaW1wb3J0IGNhcgppbXBvcnQgdGltZQoKCmNhci5pcl9tb2RlKGNhci5BUykKd2hpbGUgVHJ1ZToKICAgIGNhci5tb3ZlKCJGIiwxMDApCiAgICBpZiBjYXIub2JzdGFjbGUoKVswXSA+IDEwMDAwOgogICAgICAgIGNhci5tb3ZlKCJCIiwxMDApCiAgICAgICAgdGltZS5zbGVlcCgxKQogICAgICAgIGNhci5tb3ZlKCJSIiwxMDApCiAgICAgICAgdGltZS5zbGVlcCgwLjIpCiAgICBpZiBjYXIub2JzdGFjbGUoKVsxXSA+IDEwMDAwOgogICAgICAgIGNhci5tb3ZlKCJCIiwxMDApCiAgICAgICAgdGltZS5zbGVlcCgxKQogICAgICAgIGNhci5tb3ZlKCJMIiwxMDApCiAgICAgICAgdGltZS5zbGVlcCgwLjIpCgowIDwgNTAK</code>

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