修改 mixgo_sant

This commit is contained in:
Irene-Maxine
2025-01-09 12:42:14 +08:00
parent a9d4e9b83e
commit 6957182e71
30 changed files with 1310 additions and 309 deletions

View File

@@ -48,7 +48,7 @@
"language": "MicroPython"
},
{
"boardImg": "./boards/default/micropython_educore/media/educore.jpg",
"boardImg": "./boards/default/micropython_educore/media/educore.png",
"boardType": "Python Educore",
"boardIndex": "./boards/default/micropython_educore/index.xml",
"env": {

View File

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

View File

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

View File

@@ -0,0 +1,82 @@
"""
SANT_WCH
Micropython library for the SANT_WCH(---)
=======================================================
@dahanzimin From the Mixly Team
"""
_BOT035_ADDRESS = const(0x13)
_BOT5_TOUCH = const(0x01)
_BOT035_ADC = const(0x05)
_BOT035_PWM = const(0x07)
_BOT035_KB = const(0x10)
_BOT035_MS = const(0x14)
_BOT035_STR = const(0x18)
class BOT035:
def __init__(self, i2c_bus):
self._i2c = i2c_bus
def _wreg(self, reg, val):
'''Write memory address'''
self._i2c.writeto_mem(_BOT035_ADDRESS, reg, val.to_bytes(1, 'little'))
def _rreg(self, reg, nbytes=1):
'''Read memory address'''
self._i2c.writeto(_BOT035_ADDRESS, reg.to_bytes(1, 'little'))
return self._i2c.readfrom(_BOT035_ADDRESS, nbytes)[0]
def key_adc(self):
return (self._rreg(_BOT035_ADC) | self._rreg(_BOT035_ADC + 1) << 8)
def touch(self, index, value=None):
index = max(min(index, 1), 0)
touch = 4095 - (self._rreg(_BOT5_TOUCH + index * 2) | self._rreg(_BOT5_TOUCH + index * 2 + 1) << 8)
return touch > value if value else touch
def touched(self, index, value=600):
return self.touch(index, value)
def touch_slide(self):
values = []
for i in range(30):
values.append((self.touch(1) - self._touchs[1]) - (self.touch(0) - self._touchs[0]))
return round(sorted(values)[15] / 10)
def usben(self, index=1, duty=None, freq=None):
index = max(min(index, 3), 1) - 1
if duty is not None:
duty = max(min(duty, 100), 0)
self._wreg(_BOT035_PWM + index + 2, int(duty))
if freq is not None:
freq = max(min(freq, 65535), 10)
self._wreg(_BOT035_PWM, freq & 0xFF)
self._wreg(_BOT035_PWM + 1, freq >> 8)
if freq is None and duty is None:
return self._rreg(_BOT035_PWM + index + 2), self._rreg(_BOT035_PWM) | self._rreg(_BOT035_PWM + 1) << 8
def hid_keyboard(self, special=0, general=0, release=True):
self._buf = bytearray(4)
self._buf[0] = special
if type(general) in (tuple, list):
for i in range(len(general)):
if i > 2: break
self._buf[i + 1] = general[i]
else:
self._buf[1] = general
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_KB, self._buf)
if release:
time.sleep_ms(10)
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_KB, bytes(4))
def hid_keyboard_str(self, string, delay=0):
for char in str(string):
self._wreg(_BOT035_STR, ord(char) & 0xFF)
time.sleep_ms(20 + delay)
def hid_mouse(self, keys=0, move=(0, 0), wheel=0, release=True):
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_MS, bytes([keys & 0x0F, move[0] & 0xFF, move[1] & 0xFF, wheel & 0xFF]))
if release:
time.sleep_ms(10)
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_MS, bytes(4))

View File

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

View File

@@ -0,0 +1,107 @@
"""
ST7789/FrameBuffer
MicroPython library for the ST7789(TFT-SPI)
=======================================================
#Preliminary composition 20240110
@dahanzimin From the Mixly Team
"""
import time, uframebuf
from machine import Pin, PWM
from micropython import const
_CMD_SWRESET = const(0x01)
_CMD_SLPIN = const(0x10)
_CMD_SLPOUT = const(0x11)
_CMD_PTLON = const(0x12)
_CMD_NORON = const(0x13)
_CMD_INVOFF = const(0x20)
_CMD_INVON = const(0x21)
_CMD_DISPOFF = const(0x28)
_CMD_DISPON = const(0x29)
_CMD_CASET = const(0x2A)
_CMD_RASET = const(0x2B)
_CMD_RAMWR = const(0x2C)
_CMD_RAMRD = const(0x2E)
_CMD_PTLAR = const(0x30)
_CMD_VSCRDEF = const(0x33)
_CMD_COLMOD = const(0x3A)
_CMD_MADCTL = const(0x36)
class ST7789(uframebuf.FrameBuffer_Uincode):
def __init__(self, spi, width, height, dc_pin=None, cs_pin=None, bl_pin=None, font_address=0x700000):
if height != 240 or width not in [320, 240, 135]:
raise ValueError("Unsupported display. 320x240, 240x240 and 135x240 are supported.")
self.spi = spi
self.dc = Pin(dc_pin, Pin.OUT, value=1)
self.cs = Pin(cs_pin, Pin.OUT, value=1) if cs_pin is not None else None
self._buffer = bytearray(width * height * 2)
super().__init__(self._buffer, width, height, uframebuf.RGB565)
self.font(font_address)
self._init()
self.show()
time.sleep_ms(100)
self._brightness = 0.6
self.bl_led = PWM(Pin(bl_pin), duty_u16=int(self._brightness * 60000)) if bl_pin is not None else None
def _write(self, cmd, dat = None):
if self.cs: self.cs.off()
self.dc.off()
self.spi.write(bytearray([cmd]))
if self.cs: self.cs.on()
if dat is not None:
if self.cs: self.cs.off()
self.dc.on()
self.spi.write(dat)
if self.cs: self.cs.on()
def _init(self):
"""Display initialization configuration"""
for cmd, data, delay in [
##(_CMD_SWRESET, None, 20000),
(_CMD_SLPOUT, None, 120000),
(_CMD_MADCTL, b'\x00', 50),
(_CMD_COLMOD, b'\x05', 50),
(0xB2, b'\x0c\x0c\x00\x33\x33', 10),
(0xB7, b'\x35', 10),
(0xBB, b'\x19', 10),
(0xC0, b'\x2C', 10),
(0xC2, b'\x01', 10),
(0xC3, b'\x12', 10),
(0xC4, b'\x20', 10),
(0xC6, b'\x0F', 10),
(0xD0, b'\xA4\xA1', 10),
(0xE0, b'\xD0\x04\x0D\x11\x13\x2B\x3F\x54\x4C\x18\x0D\x0B\x1F\x23', 10),
(0xE1, b'\xD0\x04\x0C\x11\x13\x2C\x3F\x44\x51\x2F\x1F\x1F\x20\x23', 10),
(0x21, None, 10),
(0x29, None, 10),
# (_CMD_INVOFF, None, 10),
# (_CMD_NORON, None, 10),
# (_CMD_DISPON, None, 200),
]:
self._write(cmd, data)
if delay:
time.sleep_us(delay)
def get_brightness(self):
return self._brightness
def set_brightness(self, brightness):
if not 0.0 <= brightness <= 1.0:
raise ValueError("Brightness must be a decimal number in the range: 0.0~1.0")
self._brightness = brightness
self.bl_led.duty_u16(int(brightness*60000))
def color(self, red, green=None, blue=None):
""" Convert red, green and blue values (0-255) into a 16-bit 565 encoding."""
if green is None or blue is None:
return red
else:
return (red & 0xf8) << 8 | (green & 0xfc) << 3 | blue >> 3
def show(self):
"""Refresh the display and show the changes."""
self._write(_CMD_CASET, b'\x00\x00\x01\x3f')
self._write(_CMD_RASET, b'\x00\x00\x00\xef')
self._write(_CMD_RAMWR, self._buffer)

View File

@@ -1,8 +1,7 @@
{
"board": {
"元控青春": "micropython:esp32s3:mixgo_nova",
"元控": "micropython:esp32s3:mixgo_zero",
"MixGo Sant": "micropython:esp32c3:mixgo_sant"
"元控自强": "micropython:esp32s3:mixgo_sant"
},
"language": "MicroPython",
"burn": {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -951,7 +951,7 @@ export const set_power_output = {
this.appendDummyInput()
.appendField(Blockly.Msg.LISTS_SET_INDEX_SET + Blockly.Msg.ME_GO_MOTOR_EXTERN)
.appendField(Blockly.Msg.PIN_NUMBERING)
.appendField(new Blockly.FieldDropdown([["1", "1"], ["2", "2"]]), "index");
.appendField(new Blockly.FieldDropdown([["1", "1"], ["2", "2"], ["3", "3"]]), "index");
this.appendValueInput('duty')
.setCheck(Number)
.setAlign(Blockly.inputs.Align.RIGHT)

View File

@@ -389,6 +389,25 @@ export const radar_set_DETECTION_THRESHOLD = {
}
};
export const radar_set_DETECTION_THRESHOLD_SANT = {
init: function () {
this.setColour(SENSOR_EXTERN_HUE);
this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_RADAR+'CBR817')
.appendField(Blockly.Msg.LISTS_SET_INDEX_SET + Blockly.Msg.MIXlY_INTERACTION)
this.appendValueInput('VAR')
.appendField(Blockly.Msg.MIXLY_DETECTION_THRESHOLD);
this.appendValueInput('VAR2')
.appendField(Blockly.Msg.MIXLY_DELAY_TIME);
this.appendDummyInput()
.appendField('ms');
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setInputsInline(true);
this.setTooltip(Blockly.Msg.MIXLY_THRESHOLD_TOOLTIP+' ; '+Blockly.Msg.MIXLY_DELAY_TIME_RANGE)
}
};
export const interaction_whether_to_interaction = {
init:function(){
this.setColour(SENSOR_EXTERN_HUE);
@@ -402,6 +421,17 @@ export const interaction_whether_to_interaction = {
}
};
export const interaction_whether_to_interaction_SANT = {
init:function(){
this.setColour(SENSOR_EXTERN_HUE);
this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_RADAR+'CBR817')
.appendField(Blockly.Msg.MIXLY_GET_TO_INTERACTION)
this.setOutput(true);
this.setInputsInline(true);
}
};
export const CI130X_IDENTIFY_AND_SAVE = {
init:function(){
this.setColour(SENSOR_EXTERN_HUE);

View File

@@ -400,22 +400,21 @@ export const sensor_mixgo_pin_near = {
init: function () {
this.setColour(SENSOR_ONBOARD_HUE);
this.appendDummyInput()
.appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_GET)
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.mixpy_PL_TEXT_TOP, "l"], [Blockly.Msg.mixpy_PL_TEXT_BOTTOM, "r"]]), "direction")
.appendField(Blockly.Msg.MIXLY_ESP32_NEAR);
.appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_GET + Blockly.Msg.MIXLY_ESP32_NEAR);
// .appendField(new Blockly.FieldDropdown([[Blockly.Msg.mixpy_PL_TEXT_TOP, "l"], [Blockly.Msg.mixpy_PL_TEXT_BOTTOM, "r"]]), "direction")
this.setOutput(true, Number);
this.setInputsInline(true);
var thisBlock = this;
this.setTooltip(function () {
var mode = thisBlock.getFieldValue('direction');
var mode0 = Blockly.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP;
var mode1 = Blockly.Msg.MIXLY_ESP32_NEAR;
var TOOLTIPS = {
'l': Blockly.Msg.mixpy_PL_TEXT_TOP,
'r': Blockly.Msg.mixpy_PL_TEXT_BOTTOM,
};
return mode0 + TOOLTIPS[mode] + mode1
});
// var thisBlock = this;
// this.setTooltip(function () {
// var mode = thisBlock.getFieldValue('direction');
// var mode0 = Blockly.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP;
// var mode1 = Blockly.Msg.MIXLY_ESP32_NEAR;
// var TOOLTIPS = {
// 'l': Blockly.Msg.mixpy_PL_TEXT_TOP,
// 'r': Blockly.Msg.mixpy_PL_TEXT_BOTTOM,
// };
// return mode0 + TOOLTIPS[mode] + mode1
// });
}
};
@@ -470,22 +469,20 @@ export const sensor_mixgo_LTR308 = {
init: function () {
this.setColour(SENSOR_ONBOARD_HUE);
this.appendDummyInput()
.appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_GET)
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.mixpy_PL_TEXT_TOP, "l"], [Blockly.Msg.mixpy_PL_TEXT_BOTTOM, "r"]]), "direction")
.appendField(Blockly.Msg.MIXLY_ESP32_EXTERN_LIGHT + Blockly.Msg.MIXLY_DATA);
// .appendField(new Blockly.FieldDropdown([[Blockly.Msg.mixpy_PL_TEXT_TOP, "l"], [Blockly.Msg.mixpy_PL_TEXT_BOTTOM, "r"]]), "direction")
.appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_GET + Blockly.Msg.MIXLY_ESP32_EXTERN_LIGHT + Blockly.Msg.MIXLY_DATA);
this.setOutput(true, Number);
this.setInputsInline(true);
}
};
export const sensor_mixgo_sant_color = {
init: function () {
this.setColour(SENSOR_ONBOARD_HUE);
this.appendDummyInput()
.appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_GET + Blockly.Msg.MIXLY_COLOR_SENSOR + Blockly.Msg.MIXLY_DATA);
this.setOutput(true, Number);
this.setInputsInline(true);
var thisBlock = this;
this.setTooltip(function () {
var mode = thisBlock.getFieldValue('direction');
var mode0 = Blockly.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP;
var mode1 = Blockly.Msg.MIXLY_ESP32_EXTERN_LIGHT;
var TOOLTIPS = {
'l': Blockly.Msg.mixpy_PL_TEXT_TOP,
'r': Blockly.Msg.mixpy_PL_TEXT_BOTTOM,
};
return mode0 + TOOLTIPS[mode] + mode1
});
}
};
@@ -1513,3 +1510,218 @@ export const educore_rfid_sensor_scan_data = {
this.setInputsInline(true);
}
};
export const CI130X_IDENTIFY_AND_SAVE_SANT = {
init:function(){
this.setColour(SENSOR_ONBOARD_HUE);
this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_AipSpeech_asr + Blockly.Msg.MIXLY_IDENTIFY_ONCE_AND_SAVE)
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setInputsInline(true);
}
};
export const CI130X_GET_WHETHER_IDENTIFY_SANT = {
init:function(){
this.setColour(SENSOR_ONBOARD_HUE);
this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_AipSpeech_asr + Blockly.Msg.MIXLY_GET)
.appendField(new Blockly.FieldDropdown([
[Blockly.Msg.MIXLY_HELLO_XIAOZHI,"1"],
[Blockly.Msg.MIXLY_XIAOZHIXIAOZHI ,"2"],
[Blockly.Msg.MIXLY_THE_FIRST ,"3"],
[Blockly.Msg.MIXLY_THE_SECOND ,"4"],
[Blockly.Msg.MIXLY_THE_THIRD ,"5"],
[Blockly.Msg.MIXLY_THE_FOURTH ,"6"],
[Blockly.Msg.MIXLY_THE_FIFTH ,"7"],
[Blockly.Msg.MIXLY_THE_SIXTH ,"8"],
[Blockly.Msg.MIXLY_THE_SEVENTH ,"9"],
[Blockly.Msg.MIXLY_THE_EIGHTH ,"10"],
[Blockly.Msg.MIXLY_THE_NINTH ,"11"],
[Blockly.Msg.MIXLY_THE_TENTH ,"12"],
[Blockly.Msg.MIXLY_THE_ELEVENTH ,"13"],
[Blockly.Msg.MIXLY_THE_TWELFTH ,"14"],
[Blockly.Msg.MIXLY_THE_13TH ,"15"],
[Blockly.Msg.MIXLY_THE_14TH ,"16"],
[Blockly.Msg.MIXLY_THE_15TH ,"17"],
[Blockly.Msg.MIXLY_THE_16TH ,"18"],
[Blockly.Msg.MIXLY_THE_17TH ,"19"],
[Blockly.Msg.MIXLY_THE_18TH ,"20"],
[Blockly.Msg.MIXLY_THE_19TH ,"21"],
[Blockly.Msg.MIXLY_THE_20TH ,"22"],
[Blockly.Msg.MIXLY_Turn_on_the_lights ,"23"],
[Blockly.Msg.MIXLY_Turn_off_the_lights ,"24"],
[Blockly.Msg.MIXLY_Turn_up_the_brightness ,"25"],
[Blockly.Msg.MIXLY_Turn_down_the_brightness ,"26"],
[Blockly.Msg.MIXLY_Set_it_to_red ,"27"],
[Blockly.Msg.MIXLY_Set_it_to_orange ,"28"],
[Blockly.Msg.MIXLY_Set_it_to_yellow ,"29"],
[Blockly.Msg.MIXLY_Set_it_to_green ,"30"],
[Blockly.Msg.MIXLY_Set_it_to_cyan ,"31"],
[Blockly.Msg.MIXLY_Set_it_to_blue ,"32"],
[Blockly.Msg.MIXLY_Set_it_to_purple ,"33"],
[Blockly.Msg.MIXLY_Set_it_to_white ,"34"],
[Blockly.Msg.MIXLY_Turn_on_the_fan ,"35"],
[Blockly.Msg.MIXLY_Turn_off_the_fan ,"36"],
[Blockly.Msg.MIXLY_First_gear ,"37"],
[Blockly.Msg.MIXLY_Wind_speed_second ,"38"],
[Blockly.Msg.MIXLY_Third_gear ,"39"],
[Blockly.Msg.MIXLY_Previous ,"40"],
[Blockly.Msg.MIXLY_Next_page ,"41"],
[Blockly.Msg.MIXLY_Show_smiley_face ,"42"],
[Blockly.Msg.MIXLY_Show_crying_face ,"43"],
[Blockly.Msg.MIXLY_Show_love ,"44"],
[Blockly.Msg.MIXLY_Close_display ,"45"],
[Blockly.Msg.MIXLY_Start_execution ,"46"],
[Blockly.Msg.MIXLY_FORWARD ,"47"],
[Blockly.Msg.MIXLY_BACKWARD ,"48"],
[Blockly.Msg.MIXLY_TURNLEFT ,"49"],
[Blockly.Msg.MIXLY_TURNRIGHT ,"50"],
[Blockly.Msg.MIXLY_STOP ,"51"],
[Blockly.Msg.MIXLY_Accelerate ,"52"],
[Blockly.Msg.MIXLY_retard ,"53"],
[Blockly.Msg.ROTATION_FORWARD ,"54"],
[Blockly.Msg.ROTATION_BACKWARD ,"55"],
[Blockly.Msg.MIXLY_Query_temperature ,"56"],
[Blockly.Msg.MIXLY_Query_humidity ,"57"],
[Blockly.Msg.MIXLY_Query_brightness ,"58"],
[Blockly.Msg.MIXLY_Query_sound ,"59"],
[Blockly.Msg.MIXLY_Query_time ,"60"],
[Blockly.Msg.MIXLY_Query_distance ,"61"],
[Blockly.Msg.MIXLY_Query_pressure ,"62"],
[Blockly.Msg.MIXLY_Query_key ,"63"],
[Blockly.Msg.MIXLY_Query_touch ,"64"],
[Blockly.Msg.MIXLY_Query_color ,"65"]
]),"cmd")
.appendField(Blockly.Msg.MIXLY_WHETHER+Blockly.Msg.MIXLY_BE_IDENTIFIED);
this.setOutput(true);
this.setInputsInline(true);
}
};
export const CI130X_GET_THE_RECOGNIZED_CMD_SANT = {
init:function(){
this.setColour(SENSOR_ONBOARD_HUE);
this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_AipSpeech_asr + Blockly.Msg.MIXLY_GET)
.appendField(new Blockly.FieldDropdown([
[Blockly.Msg.MIXLY_RECOGNIZED_STATE,"status1"],
[Blockly.Msg.MIXLY_WHETHER_BROADCAST,"status2"],
[Blockly.Msg.MIXLY_THE_RECOGNIZED_CMD,"result"]
]),"key")
this.setOutput(true);
this.setInputsInline(true);
this.setTooltip(Blockly.Msg.MIXLY_CI130X_GET_THE_RECOGNIZED_STATE_TOOLTIP);
}
};
export const CI130X_BROADCAST_SANT = {
init:function(){
this.setColour(SENSOR_ONBOARD_HUE);
this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_AipSpeech_asr + Blockly.Msg.MIXLY_MP3_PLAY)
.appendField(new Blockly.FieldDropdown([
[Blockly.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,"None"],
[Blockly.Msg.MIXLY_WIND_SPEED,"154"],
[Blockly.Msg.MIXLY_HYETAL,"155"],
[Blockly.Msg.MIXLY_TEMPERATURE,"156"],
[Blockly.Msg.MIXLY_Humidity,"157"],
[Blockly.Msg.MIXLY_Altitude, "158"],
[Blockly.Msg.MIXLY_SOUND, "159"],
[Blockly.Msg.MIXLY_BRIGHTNESS, "160"],
[Blockly.Msg.ME_GO_HALL_SENSOR_DISTANCE,"161"],
[Blockly.Msg.MIXLY_SERVO,"162"],
[Blockly.Msg.MIXLY_MICROBIT_JS_BY_ANGLE,"163"],
[Blockly.Msg.MIXLY_BUTTON2,"164"],
[Blockly.Msg.MIXLY_ESP32_TOUCH,"165"],
[Blockly.Msg.MIXLY_PAY,"166"],
[Blockly.Msg.MIXLY_CARSH_CHANGE,"167"],
[Blockly.Msg.MIXLY_COUNTDOWN,"168"],
[Blockly.Msg.MIXLY_TIMING,"169"],
[Blockly.Msg.MIXLY_AT_THE_MOMENT,"170"],
[Blockly.Msg.MIXLY_MICROBIT_JS_CURRENT_GESTURE,"171"],
[Blockly.Msg.MIXLY_FORWARD ,"172"],
[Blockly.Msg.MIXLY_BACKWARD ,"173"],
[Blockly.Msg.MIXLY_TURNLEFT ,"174"],
[Blockly.Msg.MIXLY_TURNRIGHT ,"175"],
[Blockly.Msg.MIXLY_STOP ,"176"],
[Blockly.Msg.MIXLY_Accelerate ,"177"],
[Blockly.Msg.MIXLY_retard ,"178"],
[Blockly.Msg.ROTATION_FORWARD ,"179"],
[Blockly.Msg.ROTATION_BACKWARD ,"180"],
[Blockly.Msg.TUPLE_JOIN,"181"],
[Blockly.Msg.MIXLY_SHOW,"182"],
[Blockly.Msg.MIXLY_LAMPLIGHT,"183"],
[Blockly.Msg.MIXLY_ACCELERATION,"184"]
]),"star");
this.appendValueInput('NUM')
.appendField(Blockly.Msg.MIXLY_NUMBER);
this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_UNIT)
.appendField(new Blockly.FieldDropdown([
[Blockly.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,"None"],
[Blockly.Msg.MIXLY_YEAR,"117"],
[Blockly.Msg.MIXLY_MONTH,"118"],
[Blockly.Msg.MIXLY_DAY,"119"],
[Blockly.Msg.MIXLY_HOUR,"120"],
[Blockly.Msg.MIXLY_MINUTE,"121"],
[Blockly.Msg.MIXLY_SECOND,"122"],
[Blockly.Msg.MIXLY_WEEK2,"123"],
[Blockly.Msg.MIXLY_RMB_UNIT,"124"],
[Blockly.Msg.blockpy_setheading_degree,"125"],
[Blockly.Msg.MIXLY_GEAR,"126"],
[Blockly.Msg.MIXLY_LAYER,"127"],
[Blockly.Msg.MIXLY_GRAM,"128"],
[Blockly.Msg.MIXLY_METER,"129"],
[Blockly.Msg.MIXLY_CENTIMETER,"130"],
[Blockly.Msg.MIXLY_MILLIMETER,"131"],
[Blockly.Msg.MIXLY_LUMEN,"132"],
[Blockly.Msg.MIXLY_DECIBEL,"133"],
[Blockly.Msg.MIXLY_hectopascal,"134"],
[Blockly.Msg.MIXLY_PERCENT,"135"],
[Blockly.Msg.MIXLY_CELSIUS,"136"],
[Blockly.Msg.MIXLY_METER_PER_SEC,"137"],
[Blockly.Msg.MIXLY_MICROBIT_Turn_on_display,"138"],
[Blockly.Msg.MIXLY_MICROBIT_Turn_off_display,"139"],
[Blockly.Msg.MIXLY_SUCCESS,"140"],
[Blockly.Msg.MIXLY_FAILED,"141"],
[Blockly.Msg.MIXLY_WRONG,"142"],
[Blockly.Msg.MIXLY_GOOD,"143"],
[Blockly.Msg.MIXLY_blockpy_set_add,"144"],
[Blockly.Msg.MIXLY_DECREASE,"145"],
[Blockly.Msg.COLOUR_RGB_RED,"146"],
[Blockly.Msg.COLOUR_RGB_ORANGE,"147"],
[Blockly.Msg.COLOUR_YELLOW,"148"],
[Blockly.Msg.COLOUR_RGB_GREEN,"149"],
[Blockly.Msg.COLOUR_CYAN,"150"],
[Blockly.Msg.COLOUR_RGB_BLUE,"151"],
[Blockly.Msg.COLOUR_RGB_PURPLE,"152"],
[Blockly.Msg.COLOUR_RGB_WHITE,"153"]
]),"end");
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setInputsInline(true);
}
}
export const CI130X_SET_SYSTEM_CMD_SANT = {
init:function(){
this.setColour(SENSOR_ONBOARD_HUE);
this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_AipSpeech_asr+Blockly.Msg.LISTS_SET_INDEX_SET + Blockly.Msg.MIXLY_SYSTEM + Blockly.Msg.MIXLY_CMD)
.appendField(new Blockly.FieldDropdown([
[Blockly.Msg.MILXY_ENTER_WAKE_UP,"1"],
[Blockly.Msg.MIXLY_INCREASE_VOLUME,"202"],
[Blockly.Msg.MIXLY_REDUCE_VOLUME,"203"],
[Blockly.Msg.MIXLY_MAX_VOLUME,"204"],
[Blockly.Msg.MIXLY_MINIMUM,"205"],
[Blockly.Msg.MIXLY_OPEN_RESPONSE,"206"],
[Blockly.Msg.MIXLY_CLOSE_RESPONSE,"207"],
[Blockly.Msg.MIXLY_QUIT_WAKE_UP,"208"]
]),"cmd")
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setInputsInline(true);
}
};

View File

@@ -437,7 +437,7 @@ export const get_power_output = function (_, generator) {
}
export const set_all_power_output = function (_, generator) {
var version = generator.getSelectedBoardKey().split(':')[2];
var version = Boards.getSelectedBoardKey().split(':')[2];
var duty = generator.valueToCode(this, 'duty', generator.ORDER_ATOMIC);
generator.definitions_['import_' + version + '_onboard_bot'] = 'from ' + version + ' import onboard_bot';
var code = 'onboard_bot.usben(freq = ' + duty + ')\n';

View File

@@ -231,6 +231,15 @@ export const radar_set_DETECTION_THRESHOLD = function (_, generator) {
return code;
}
export const radar_set_DETECTION_THRESHOLD_SANT = function (_, generator) {
var version = Boards.getSelectedBoardKey().split(':')[2];
generator.definitions_['import_'+version +'_ext.mmw'] = 'from '+ version +' import ext.mmw';
var value = generator.valueToCode(this, 'VAR', generator.ORDER_ATOMIC);
var value2 = generator.valueToCode(this, 'VAR2', generator.ORDER_ATOMIC);
var code = 'ext.mmw.threshold(' + value +')\n'+ 'ext.mmw.delay_ms(' + value2 +')\n';
return code;
}
export const interaction_whether_to_interaction = function(_,generator){
generator.definitions_['import_cbr817'] = 'import cbr817';
var sub = generator.valueToCode(this, 'SUB', generator.ORDER_ATOMIC);
@@ -238,6 +247,11 @@ export const interaction_whether_to_interaction = function(_,generator){
return [code,generator.ORDER_ATOMIC];
}
export const interaction_whether_to_interaction_SANT = function(_,generator){
var code = 'ext.mmw.result()';
return [code,generator.ORDER_ATOMIC];
}
export const CI130X_IDENTIFY_AND_SAVE = function(_,generator){
generator.definitions_['import_ci130x'] = 'import ci130x';
var sub = generator.valueToCode(this, 'SUB', generator.ORDER_ATOMIC);

View File

@@ -131,6 +131,13 @@ export const sensor_mixgo_pin_near_double = function (_, generator) {
}
export const sensor_mixgo_pin_near = function (_, generator) {
var version = Boards.getSelectedBoardKey().split(':')[2]
generator.definitions_['import_' + version + '_onboard_als'] = 'from ' + version + ' import onboard_als';
var code = 'onboard_als.ps()';
return [code, generator.ORDER_ATOMIC];
}
export const sensor_mixgo_nova_pin_near = function (_, generator) {
var version = Boards.getSelectedBoardKey().split(':')[2]
var direction = this.getFieldValue('direction');
generator.definitions_['import_' + version + '_' + direction] = 'from ' + version + ' import onboard_als_' + direction;
@@ -138,18 +145,27 @@ export const sensor_mixgo_pin_near = function (_, generator) {
return [code, generator.ORDER_ATOMIC];
}
export const sensor_mixgo_nova_pin_near = sensor_mixgo_pin_near;
export const sensor_mixgo_LTR308 = function (_, generator) {
var version = Boards.getSelectedBoardKey().split(':')[2]
generator.definitions_['import_' + version + '_onboard_als'] = 'from ' + version + ' import onboard_als';
var code = 'onboard_als.als()';
return [code, generator.ORDER_ATOMIC];
}
export const sensor_mixgo_sant_color = function (_, generator) {
var version = Boards.getSelectedBoardKey().split(':')[2]
generator.definitions_['import_' + version + '_onboard_als'] = 'from ' + version + ' import onboard_als';
var code = 'onboard_als.coclor()';
return [code, generator.ORDER_ATOMIC];
}
export const sensor_mixgo_nova_LTR308 = function (_, generator) {
var direction = this.getFieldValue('direction');
generator.definitions_['import_' + version + '_' + direction] = 'from ' + version + ' import onboard_als_' + direction;
var code = 'onboard_als_' + direction + '.als_vis()';
return [code, generator.ORDER_ATOMIC];
}
export const sensor_mixgo_nova_LTR308 = sensor_mixgo_LTR308;
export const sensor_ds18x20 = function (_, generator) {
generator.definitions_['import_ds18x20x'] = 'import ds18x20x';
var dropdown_pin = generator.valueToCode(this, 'PIN', generator.ORDER_ATOMIC);
@@ -342,10 +358,10 @@ export const sensor_mpu9250_get_acceleration = function (_, generator) {
export const sensor_mixgoce_pin_pressed = function (_, generator) {
var version = Boards.getSelectedBoardKey().split(':')[2]
var pin = generator.valueToCode(this, 'button', generator.ORDER_ATOMIC);
if (version == 'mixgo_mini') {
if ( 'mixgo_mini'|| version == 'mixgo_sant') {
generator.definitions_['import_' + version + '_onboard_bot'] = 'from ' + version + ' import onboard_bot';
var code = 'onboard_bot.touched(' + pin + ')';
} else {
}else {
generator.definitions_['import_' + version] = 'import ' + version;
var code = version + '.touched(' + pin + ')';
}
@@ -354,7 +370,7 @@ export const sensor_mixgoce_pin_pressed = function (_, generator) {
export const sensor_mixgo_touch_slide = function (_, generator) {
var version = Boards.getSelectedBoardKey().split(':')[2]
if (version == 'mixgo_mini') {
if (version == 'mixgo_mini'|| version == 'mixgo_sant') {
generator.definitions_['import_' + version + '_onboard_bot'] = 'from ' + version + ' import onboard_bot';
var code = 'onboard_bot.touch_slide()';
} else {
@@ -854,3 +870,50 @@ export const educore_rfid_sensor_scan_data = function (_, generator) {
var code = sub+'.'+key+'()';
return [code, generator.ORDER_ATOMIC];
}
export const CI130X_IDENTIFY_AND_SAVE_SANT = function(_,generator){
var version = Boards.getSelectedBoardKey().split(':')[2]
generator.definitions_['import_' + version + '_onboard_asr'] = 'from ' + version + ' import onboard_asr';
var code = 'onboard_asr.cmd_id()\n';
return code;
}
export const CI130X_GET_WHETHER_IDENTIFY_SANT = function(_,generator){
var version = Boards.getSelectedBoardKey().split(':')[2]
generator.definitions_['import_' + version + '_onboard_asr'] = 'from ' + version + ' import onboard_asr';
var cmd = this.getFieldValue('cmd');
var code = 'onboard_asr.result('+cmd+')';
return [code,generator.ORDER_ATOMIC];
}
export const CI130X_GET_THE_RECOGNIZED_CMD_SANT = function(_,generator){
var version = Boards.getSelectedBoardKey().split(':')[2]
generator.definitions_['import_' + version + '_onboard_asr'] = 'from ' + version + ' import onboard_asr';
var key = this.getFieldValue('key');
if(key == 'status1'){
var code = 'onboard_asr.status()[0]';
}else if(key == 'status2'){
var code = 'onboard_asr.status()[1]';
}else{
var code = 'onboard_asr.'+key +'()';
}
return [code,generator.ORDER_ATOMIC];
}
export const CI130X_BROADCAST_SANT = function(_,generator){
var version = Boards.getSelectedBoardKey().split(':')[2]
generator.definitions_['import_' + version + '_onboard_asr'] = 'from ' + version + ' import onboard_asr';
var num = generator.valueToCode(this, 'NUM', generator.ORDER_ATOMIC);
var star = this.getFieldValue('star');
var end = this.getFieldValue('end');
var code = 'onboard_asr.play('+star+','+num+','+end+')\n';
return code;
}
export const CI130X_SET_SYSTEM_CMD_SANT = function(_,generator){
var version = Boards.getSelectedBoardKey().split(':')[2]
generator.definitions_['import_' + version + '_onboard_asr'] = 'from ' + version + ' import onboard_asr';
var cmd = this.getFieldValue('cmd');
var code = 'onboard_asr.sys_cmd('+cmd+')\n';
return code;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

View File

@@ -1728,7 +1728,8 @@
</shadow>
</value>
</block>
<block type="analog_keyboard_str" m-show="micropython:esp32c2:mixgo_mini">; <value name="str">
<block type="analog_keyboard_str" m-show="micropython:esp32c2:mixgo_mini">
<value name="str">
<shadow type="text">
<field name="TEXT">Hello, Mixly!</field>
</shadow>

View File

@@ -0,0 +1,149 @@
import * as Blockly from 'blockly/core';
import { Boards } from 'mixly';
const MEG1_HUE = 40;
// export const mini_g2_aht11 = {
// init: function () {
// var version = Boards.getSelectedBoardKey().split(':')[2]
// if (version == "mixgo_me") { var name = 'ME G1' }
// this.setColour(MEG1_HUE);
// this.appendDummyInput("")
// .appendField(name)
// .appendField(Blockly.Msg.MIXLY_TEM_HUM + " AHT21")
// .appendField(new Blockly.FieldDropdown([
// [Blockly.Msg.MIXLY_GETTEMPERATUE, "temperature"],
// [Blockly.Msg.MIXLY_GETHUMIDITY, "humidity"]
// ]), "key");
// this.setOutput(true, Number);
// this.setInputsInline(true);
// var thisBlock = this;
// this.setTooltip(function () {
// var mode = thisBlock.getFieldValue('key');
// var TOOLTIPS = {
// "temperature": Blockly.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,
// "relative_humidity": Blockly.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP
// };
// return TOOLTIPS[mode]
// });
// }
// };
// export const mini_g2_hp203 = {
// init: function () {
// var version = Boards.getSelectedBoardKey().split(':')[2]
// if (version == "mixgo_me") { var name = 'ME G1' }
// this.setColour(MEG1_HUE);
// this.appendDummyInput("")
// .appendField(name)
// .appendField(Blockly.Msg.MIXLY_Altitude + Blockly.Msg.MSG.catSensor + " HP203X")
// .appendField(new Blockly.FieldDropdown([
// [Blockly.Msg.MIXLY_GETPRESSURE, "pressure()"],
// [Blockly.Msg.MIXLY_GETTEMPERATUE, "temperature()"],
// [Blockly.Msg.MIXLY_GET_ALTITUDE, "altitude()"],
// ]), "key");
// this.setOutput(true, Number);
// this.setInputsInline(true);
// }
// };
// export const mini_g2_varistor = {
// init: function () {
// var version = Boards.getSelectedBoardKey().split(':')[2]
// if (version == "mixgo_me") { var name = 'ME G1' }
// this.setColour(MEG1_HUE);
// this.appendDummyInput()
// .appendField(name)
// .appendField(Blockly.Msg.MIXLY_MIXGO_NOVA_POTENTIAL_NUM);
// this.setOutput(true, Number);
// this.setInputsInline(true);
// }
// };
export const mini_g2_rfid_readid = {
init: function () {
var version = Boards.getSelectedBoardKey().split(':')[2]
if (version == "mixgo_me") { var name = 'ME G1' }
this.setColour(MEG1_HUE);
this.appendDummyInput()
.appendField(name)
.appendField("RFID" + Blockly.Msg.MIXLY_RFID_READ_CARD);
this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_RFID_READ_CARD_UID);
this.setOutput(true, Number);
this.setInputsInline(true);
}
};
export const mini_g2_rfid_readcontent = {
init: function () {
var version = Boards.getSelectedBoardKey().split(':')[2]
if (version == "mixgo_me") { var name = 'ME G1' }
this.setColour(MEG1_HUE);
this.appendDummyInput()
.appendField(name)
.appendField("RFID" + Blockly.Msg.MIXLY_RFID_READ_CARD);
this.appendValueInput('SECTOR')
.appendField(Blockly.Msg.MIXLY_LIST_INDEX)
this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL);
this.setOutput(true, Number);
this.setInputsInline(true);
}
};
export const mini_g2_rfid_write = {
init: function () {
var version = Boards.getSelectedBoardKey().split(':')[2]
if (version == "mixgo_me") { var name = 'ME G1' }
this.setColour(MEG1_HUE);
this.appendDummyInput()
.appendField(name)
.appendField(Blockly.Msg.MIXLY_COMMUNICATION_RFID_WRITE);
this.appendValueInput('SECTOR')
.appendField(Blockly.Msg.MIXLY_LIST_INDEX)
this.appendValueInput('CONTENT')
.appendField(Blockly.Msg.MIXLY_COMMUNICATION_WRITE_NUM)
this.setInputsInline(true);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
}
};
export const mini_g2_rfid_write_outcome = {
init: function () {
var version = Boards.getSelectedBoardKey().split(':')[2]
if (version == "mixgo_me") { var name = 'ME G1' }
this.setColour(MEG1_HUE);
this.appendDummyInput()
.appendField(name)
.appendField(Blockly.Msg.MIXLY_COMMUNICATION_RFID_WRITE);
this.appendValueInput('SECTOR')
.appendField(Blockly.Msg.MIXLY_LIST_INDEX)
this.appendValueInput('CONTENT')
.appendField(Blockly.Msg.MIXLY_COMMUNICATION_WRITE_NUM)
this.appendDummyInput()
.appendField(Blockly.Msg.RETURN_SUCCESS_OR_NOT)
this.setInputsInline(true);
this.setOutput(true);
}
};
export const mini_g2_rfid_status = {
init: function () {
var version = Boards.getSelectedBoardKey().split(':')[2]
if (version == "mixgo_me") { var name = 'ME G1' }
this.setColour(MEG1_HUE);
this.appendDummyInput()
.appendField(name)
.appendField("RFID");
this.appendDummyInput("")
.appendField(new Blockly.FieldDropdown([
[Blockly.Msg.MIXLY_RFID_SCAN_OK, "True"],
[Blockly.Msg.MIXLY_RFID_SCAN_NOTAGERR, "None"],
[Blockly.Msg.MIXLY_RFID_SCAN_ERROR, "False"]
]), "key");
this.setOutput(true, Number);
this.setInputsInline(true);
}
};

View File

@@ -118,20 +118,12 @@ div.blocklyToolboxDiv > div.blocklyToolboxContents > div:nth-child(12) > div.blo
background:url('../../../../common/media/mark/display_new2.png') no-repeat;
background-size: 100% auto;
}
#catME_GO.blocklyTreeRow > div.blocklyTreeRowContentContainer > span.blocklyTreeIcon{
background:url('../../../../common/media/mark/act.png') no-repeat;
#catSANT_G2.blocklyTreeRow > div.blocklyTreeRowContentContainer > span.blocklyTreeIcon{
background:url('../../../../common/media/mark/sensor.png') no-repeat;
background-size: 100% auto;
}
#catME_GO.blocklyTreeRow.blocklyTreeSelected > div.blocklyTreeRowContentContainer > span.blocklyTreeIcon{
background:url('../../../../common/media/mark/act2.png') no-repeat;
background-size: 100% auto;
}
#catCE_G6.blocklyTreeRow > div.blocklyTreeRowContentContainer > span.blocklyTreeIcon{
background:url('../../../../common/media/mark/act.png') no-repeat;
background-size: 100% auto;
}
#catCE_G6.blocklyTreeRow.blocklyTreeSelected > div.blocklyTreeRowContentContainer > span.blocklyTreeIcon{
background:url('../../../../common/media/mark/act2.png') no-repeat;
#catSANT_G2.blocklyTreeRow.blocklyTreeSelected > div.blocklyTreeRowContentContainer > span.blocklyTreeIcon{
background:url('../../../../common/media/mark/sensor2.png') no-repeat;
background-size: 100% auto;
}
#catExternSensor.blocklyTreeRow > div.blocklyTreeRowContentContainer > span.blocklyTreeIcon{

View File

@@ -1,13 +1,17 @@
import MicropythonESP32S3Pins from './blocks/esp32_profile';
import * as MicropythonESP32S3InoutBlocks from './blocks/inout';
import * as MicropythonESP32S3PinsBlocks from './blocks/pins';
import * as MicropythonESP32S3SANTG2Blocks from './blocks/sant_g2';
import * as MicropythonESP32S3InoutGenerators from './generators/inout';
import * as MicropythonESP32S3PinsGenerators from './generators/pins';
import * as MicropythonESP32S3SANTG2Generators from './generators/sant_g2';
export {
MicropythonESP32S3Pins,
MicropythonESP32S3InoutBlocks,
MicropythonESP32S3PinsBlocks,
MicropythonESP32S3SANTG2Blocks,
MicropythonESP32S3InoutGenerators,
MicropythonESP32S3PinsGenerators
MicropythonESP32S3PinsGenerators,
MicropythonESP32S3SANTG2Generators
};

View File

@@ -0,0 +1,88 @@
import { Boards } from 'mixly';
// export const mini_g2_aht11 = function (_, generator) {
// var key = this.getFieldValue('key');
// generator.definitions_['import_mini_g2'] = 'import mini_g2';
// var code = 'mini_g2.ext_ahtx0.' + key + '()';
// return [code, generator.ORDER_ATOMIC];
// }
// export const mini_g2_hp203 = function (_, generator) {
// var key = this.getFieldValue('key');
// generator.definitions_['import_mini_g2'] = 'import mini_g2';
// var code = 'mini_g2.ext_hp203x.' + key;
// return [code, generator.ORDER_ATOMIC];
// }
// export const mini_g2_varistor = function (_, generator) {
// generator.definitions_['import_mini_g2'] = 'import mini_g2';
// var code = 'mini_g2.varistor()';
// return [code, generator.ORDER_ATOMIC];
// }
export const mini_g2_rfid_readid = function (_, generator) {
generator.definitions_['import_mini_g2'] = 'import mini_g2';
var version = Boards.getSelectedBoardKey().split(':')[2];
if (version == "mixgo_mini") {
generator.definitions_['import_mini_g2_ext_rfid'] = 'from mini_g2 import ext_rfid';
var code = 'ext_rfid.read_card(0, x="id")';
} else {
generator.definitions_['import_mini_g2'] = 'import mini_g2';
var code = 'mini_g2.ext_rc522.read_card(0, x="id")';
}
return [code, generator.ORDER_ATOMIC];
}
export const mini_g2_rfid_readcontent = function (_, generator) {
var version = Boards.getSelectedBoardKey().split(':')[2];
var sector = generator.valueToCode(this, 'SECTOR', generator.ORDER_ATOMIC);
if (version == "mixgo_mini") {
generator.definitions_['import_mini_g2_ext_rfid'] = 'from mini_g2 import ext_rfid';
var code = 'ext_rfid.read_card(' + sector + ')';
} else {
generator.definitions_['import_mini_g2'] = 'import mini_g2';
var code = 'mini_g2.ext_rc522.read_card(' + sector + ')';
}
return [code, generator.ORDER_ATOMIC];
}
export const mini_g2_rfid_write = function (_, generator) {
var version = Boards.getSelectedBoardKey().split(':')[2];
var sector = generator.valueToCode(this, 'SECTOR', generator.ORDER_ATOMIC);
var cnt = generator.valueToCode(this, 'CONTENT', generator.ORDER_ATOMIC);
if (version == "mixgo_mini") {
generator.definitions_['import_mini_g2_ext_rfid'] = 'from mini_g2 import ext_rfid';
var code = 'ext_rfid.write_card(' + cnt + ',' + sector + ')\n';
} else {
generator.definitions_['import_mini_g2'] = 'import mini_g2';
var code = 'mini_g2.ext_rc522.write_card(' + cnt + ',' + sector + ')\n';
}
return code;
}
export const mini_g2_rfid_write_outcome = function (_, generator) {
var version = Boards.getSelectedBoardKey().split(':')[2];
var sector = generator.valueToCode(this, 'SECTOR', generator.ORDER_ATOMIC);
var cnt = generator.valueToCode(this, 'CONTENT', generator.ORDER_ATOMIC);
if (version == "mixgo_mini") {
generator.definitions_['import_mini_g2_ext_rfid'] = 'from mini_g2 import ext_rfid';
var code = 'ext_rfid.write_card(' + cnt + ',' + sector + ')';
} else {
generator.definitions_['import_mini_g2'] = 'import mini_g2';
var code = 'mini_g2.ext_rc522.write_card(' + cnt + ',' + sector + ')';
}
return [code, generator.ORDER_ATOMIC];
}
export const mini_g2_rfid_status = function (_, generator) {
var version = Boards.getSelectedBoardKey().split(':')[2];
var key = this.getFieldValue('key');
if (version == "mixgo_mini") {
generator.definitions_['import_mini_g2_ext_rfid'] = 'from mini_g2 import ext_rfid';
var code = 'ext_rfid.scan_card()==' + key;
} else {
generator.definitions_['import_mini_g2'] = 'import mini_g2';
var code = 'mini_g2.ext_rc522.scan_card()==' + key;
}
return [code, generator.ORDER_ATOMIC];
}

View File

@@ -78,8 +78,10 @@ import {
MicropythonESP32S3Pins,
MicropythonESP32S3InoutBlocks,
MicropythonESP32S3PinsBlocks,
MicropythonESP32S3SANTG2Blocks,
MicropythonESP32S3InoutGenerators,
MicropythonESP32S3PinsGenerators
MicropythonESP32S3PinsGenerators,
MicropythonESP32S3SANTG2Generators
} from './';
import './css/color_esp32s2_mixgoce.css';
@@ -128,7 +130,8 @@ Object.assign(
MicroPythonBlynkBlocks,
MicroPythonNovaG1Blocks,
MicropythonESP32S3InoutBlocks,
MicropythonESP32S3PinsBlocks
MicropythonESP32S3PinsBlocks,
MicropythonESP32S3SANTG2Blocks
);
Object.assign(
@@ -166,5 +169,6 @@ Object.assign(
MicroPythonBlynkGenerators,
MicroPythonNovaG1Generators,
MicropythonESP32S3InoutGenerators,
MicropythonESP32S3PinsGenerators
MicropythonESP32S3PinsGenerators,
MicropythonESP32S3SANTG2Generators
);

View File

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

View File

@@ -1,8 +1,7 @@
{
"board": {
"元控青春": "micropython:esp32s3:mixgo_nova",
"元控": "micropython:esp32s3:mixgo_zero",
"MixGo Sant": "micropython:esp32c3:mixgo_sant"
"元控自强": "micropython:esp32s3:mixgo_sant"
},
"language": "MicroPython",
"burn": {

View File

@@ -1420,32 +1420,33 @@
</value>
</block>
<block type="sensor_mixgo_touch_slide"></block>
<block type="sensor_mixgo_pin_near" m-show='micropython:esp32s3:mixgo_zero'></block>
<block type="sensor_mixgo_nova_pin_near" m-show='micropython:esp32s3:mixgo_nova'></block>
<block type="sensor_mixgo_LTR308" m-show='micropython:esp32s3:mixgo_zero'></block>
<block type="sensor_mixgo_nova_LTR308" m-show='micropython:esp32s3:mixgo_nova'></block>
<block type="sensor_mixgo_pin_near" m-show='micropython:esp32s3:mixgo_sant'></block>
<!-- <block type="sensor_mixgo_nova_pin_near" m-show='micropython:esp32s3:mixgo_nova'></block> -->
<block type="sensor_mixgo_LTR308" m-show='micropython:esp32s3:mixgo_sant'></block>
<!-- <block type="sensor_mixgo_nova_LTR308" m-show='micropython:esp32s3:mixgo_nova'></block> -->
<block type="sensor_mixgo_sant_color" m-show='micropython:esp32s3:mixgo_sant'></block>
<block type="sensor_sound"></block>
<block type="sensor_hp203" m-show='micropython:esp32s3:mixgo_zero'></block>
<block type="sensor_hp203" m-show='micropython:esp32s3:mixgo_sant'></block>
<block type="sensor_aht11"></block>
<block type="sensor_get_acceleration"></block>
<block type="sensor_mixgo_cc_mmc5603_calibrate_compass"></block>
<block type="sensor_mixgo_cc_mmc5603_get_magnetic"></block>
<block type="sensor_mixgo_cc_mmc5603_get_angle"></block>
<block type="rfid_readid">
<block type="rfid_readid" m-hide='micropython:esp32s3:mixgo_sant'>
<value name="SUB">
<shadow type="variables_get">
<field name="VAR">rfid</field>
</shadow>
</value>
</block>
<block type="rfid_readcontent">
<block type="rfid_readcontent" m-hide='micropython:esp32s3:mixgo_sant'>
<value name="SECTOR">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
</value>
</block>
<block type="rfid_write">
<block type="rfid_write" m-hide='micropython:esp32s3:mixgo_sant'>
<value name="SECTOR">
<shadow type="math_number">
<field name="NUM">0</field>
@@ -1457,7 +1458,7 @@
</shadow>
</value>
</block>
<block type="rfid_write_return">
<block type="rfid_write_return" m-hide='micropython:esp32s3:mixgo_sant'>
<value name="SECTOR">
<shadow type="math_number">
<field name="NUM">0</field>
@@ -1469,6 +1470,15 @@
</shadow>
</value>
</block>
<block type="CI130X_IDENTIFY_AND_SAVE_SANT" m-show='micropython:esp32s3:mixgo_sant'></block>
<block type="CI130X_GET_WHETHER_IDENTIFY_SANT" m-show='micropython:esp32s3:mixgo_sant'></block>
<block type="CI130X_GET_THE_RECOGNIZED_CMD_SANT" m-show='micropython:esp32s3:mixgo_sant'></block>
<block type="CI130X_BROADCAST_SANT" m-show='micropython:esp32s3:mixgo_sant'>
<value name="NUM">
<block type="logic_null"></block>
</value>
</block>
<block type = "CI130X_SET_SYSTEM_CMD_SANT" m-show='micropython:esp32s3:mixgo_sant'></block>
<block type="onboard_RTC_set_datetime">
<value name="year">
<shadow type="math_number">
@@ -1559,7 +1569,7 @@
</shadow>
</value>
</block>
<block type="actuator_mixgo_zero_led_color" m-show='micropython:esp32s3:mixgo_zero'>
<block type="actuator_mixgo_zero_led_color" m-show='micropython:esp32s3:mixgo_sant'>
<value name="led">
<shadow type="number">
</shadow>
@@ -1569,22 +1579,22 @@
</shadow>
</value>
</block>
<block type="actuator_mixgo_nova_mic_set">
<block type="actuator_mixgo_nova_mic_set" m-hide='micropython:esp32s3:mixgo_sant'>
<value name="bright">
<shadow type="math_number">
<field name="NUM">100</field>
</shadow>
</value>
</block>
<block type="actuator_mixgo_nova_mic_get"></block>
<block type="actuator_mixgo_nova_voice_set">
<block type="actuator_mixgo_nova_mic_get" m-hide='micropython:esp32s3:mixgo_sant'></block>
<block type="actuator_mixgo_nova_voice_set" m-hide='micropython:esp32s3:mixgo_sant'>
<value name="bright">
<shadow type="math_number">
<field name="NUM">100</field>
</shadow>
</value>
</block>
<block type="actuator_mixgo_nova_voice_get"></block>
<block type="actuator_mixgo_nova_voice_get" m-hide='micropython:esp32s3:mixgo_sant'></block>
<!-- <block type="actuator_mixgo_nova_onboard_music_pitch">
<value name="pitch">
<shadow type="pins_tone_notes">
@@ -1592,7 +1602,7 @@
</shadow>
</value>
</block> -->
<block type="esp32_onboard_music_pitch_with_time">
<block type="esp32_onboard_music_pitch_with_time" m-hide='micropython:esp32s3:mixgo_sant'>
<value name="pitch">
<shadow type="pins_tone_notes">
<field name="PIN">440</field>
@@ -1611,12 +1621,12 @@
</shadow>
</value>
</block> -->
<block type="esp32_onboard_music_play_list">
<block type="esp32_onboard_music_play_list" m-hide='micropython:esp32s3:mixgo_sant'>
<value name="LIST">
<shadow type="pins_playlist"></shadow>
</value>
</block>
<block type="actuator_mixgo_nova_record_audio">
<block type="actuator_mixgo_nova_record_audio" m-hide='micropython:esp32s3:mixgo_sant'>
<value name="PATH">
<shadow type="text">
<field name="TEXT">/sd/1.wav</field>
@@ -1628,14 +1638,14 @@
</shadow>
</value>
</block>
<block type="actuator_mixgo_nova_play_audio">
<block type="actuator_mixgo_nova_play_audio" m-hide='micropython:esp32s3:mixgo_sant'>
<value name="PATH">
<shadow type="text">
<field name="TEXT">/sd/1.wav</field>
</shadow>
</value>
</block>
<block type="actuator_mixgo_nova_play_online_audio">
<block type="actuator_mixgo_nova_play_online_audio" m-hide='micropython:esp32s3:mixgo_sant'>
<value name="PATH">
<shadow type="text">
<field name="TEXT">https://gitee.com/dahanzimin/test/raw/master/wav/8.wav</field>
@@ -1643,6 +1653,52 @@
</value>
</block>
<block type="esp32_onboard_music_pitch" m-show='micropython:esp32s3:mixgo_sant'>
<value name="pitch">
<shadow type="pins_tone_notes">
<field name="PIN">440</field>
</shadow>
</value>
</block>
<block type="esp32_onboard_music_pitch_with_time" m-show='micropython:esp32s3:mixgo_sant'>
<value name="pitch">
<shadow type="pins_tone_notes">
<field name="PIN">440</field>
</shadow>
</value>
<value name="time">
<shadow type="math_number">
<field name="NUM">1000</field>
</shadow>
</value>
</block>
<block type="esp32_onboard_music_stop" m-show='micropython:esp32s3:mixgo_sant'>
<value name="PIN">
<shadow type="pins_pwm_pin">
<field name="PIN">0</field>
</shadow>
</value>
</block>
<block type="esp32_onboard_music_play_list" m-show='micropython:esp32s3:mixgo_sant'>
<value name="LIST">
<shadow type="pins_playlist"></shadow>
</value>
</block>
<block type="esp32_music_set_tempo" m-show='micropython:esp32s3:mixgo_sant'>
<value name="TICKS">
<shadow type="math_number">
<field name="NUM">4</field>
</shadow>
</value>
<value name="BPM">
<shadow type="math_number">
<field name="NUM">120</field>
</shadow>
</value>
</block>
<block type="esp32_music_get_tempo" m-show='micropython:esp32s3:mixgo_sant'></block>
<block type="esp32_music_reset" m-show='micropython:esp32s3:mixgo_sant'></block>
<block type="actuator_onboard_neopixel_rgb">
<value name="_LED_">
<shadow type="math_number">
@@ -1713,6 +1769,67 @@
</block>
<block type="actuator_onboard_neopixel_write">
</block>
<block type="set_power_output" m-show="micropython:esp32s3:mixgo_sant">
<value name="duty">
<shadow type="math_number">
<field name="NUM">100</field>
</shadow>
</value>
</block>
<block type="set_all_power_output" m-show="micropython:esp32s3:mixgo_sant">
<value name="duty">
<shadow type="math_number">
<field name="NUM">20000</field>
</shadow>
</value>
</block>
<block type="analog_keyboard_input" m-show="micropython:esp32s3:mixgo_sant">
<value name="special">
<block type="special_key">
</block>
</value>
<value name="general">
<block type="general_key">
</block>
</value>
</block>
<block type="general_key_tuple" m-show="micropython:esp32s3:mixgo_sant">
<value name="general">
<block type="general_key">
</block>
</value>
</block>
<block type="analog_mouse_input" m-show="micropython:esp32s3:mixgo_sant">
<value name="key">
<block type="mouse_key">
</block>
</value>
<value name="x">
<shadow type="math_number">
</shadow>
</value>
<value name="y">
<shadow type="math_number">
</shadow>
</value>
<value name="wheel">
<shadow type="math_number">
</shadow>
</value>
</block>
<block type="analog_keyboard_str" m-show="micropython:esp32s3:mixgo_sant">
<value name="str">
<shadow type="text">
<field name="TEXT">Hello, Mixly!</field>
</shadow>
</value>
<value name="time">
<shadow type="math_number">
<field name="NUM">10</field>
</shadow>
</value>
</block>
</category>
<category id="catOnBoardDisplay" colour='#78B5B4'>
<block type="mpython_pbm_image"></block>
@@ -2156,225 +2273,54 @@
</value>
</block>
</category>
<!-- <category id="catME_GO" colour="100">
<block type="ce_go_led_bright">
<value name="led">
<shadow type="ce_go_light_number">
</shadow>
</value>
<value name="bright">
<shadow type="ledswitch">
</shadow>
</value>
</block>
<block type="ce_go_get_led_state">
<value name="led">
<shadow type="ce_go_light_number">
</shadow>
</value>
</block>
<block type="ce_go_led_brightness">
<value name="led">
<shadow type="ce_go_light_number">
</shadow>
</value>
<value name="bright">
<shadow type="math_number">
<field name="NUM">100</field>
</shadow>
</value>
</block>
<block type="ce_go_get_led_bright">
<value name="led">
<shadow type="ce_go_light_number">
</shadow>
</value>
</block>
<block type="ce_go_stepper_keep">
<value name="speed">
<shadow type="math_number">
<field name="NUM">100</field>
</shadow>
</value>
</block>
<block type="ce_go_stepper_stop"></block>
<block type="ce_go_dc_motor">
<value name="speed">
<shadow type="math_number">
<field name="NUM">100</field>
</shadow>
</value>
</block>
<block type="ce_go_hall_initialize">
<value name="num">
<category id="catSANT_G2" colour="40" m-show='micropython:esp32s3:mixgo_sant'>
<block type="mini_g2_rfid_readcontent">
<value name="SECTOR">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
</value>
</block>
<block type="ce_go_hall_data">
</block>
<block type="ce_go_hall_attachInterrupt">
<value name="DO">
<shadow type="factory_block_return">
<field name="VALUE">interrupt_func</field>
<block type="mini_g2_rfid_readid"></block>
<block type="mini_g2_rfid_write">
<value name="SECTOR">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
</value>
<value name="CONTENT">
<shadow type="text">
<field name="TEXT">Mixly</field>
</shadow>
</value>
</block>
<block type="procedures_defnoreturn">
<mutation>
<arg name="turns"></arg>
<arg name="distance"></arg>
</mutation>
<field name="NAME">interrupt_func</field>
<statement name="STACK">
<block type="system_print_many">
<mutation items="2"></mutation>
<value name="ADD0">
<block type="variables_get">
<field name="VAR">turns</field>
</block>
</value>
<value name="ADD1">
<block type="variables_get">
<field name="VAR">distance</field>
</block>
</value>
</block>
</statement>
<block type="mini_g2_rfid_write_outcome">
<value name="SECTOR">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
</value>
<value name="CONTENT">
<shadow type="text">
<field name="TEXT">Mixly</field>
</shadow>
</value>
</block>
<block type="ce_go_pin_near_state_change"></block>
<block type="ce_go_pin_near_line"></block>
<block type="ce_go_pin_near"></block>
<block type="ce_go_pin_light"></block>
<block type="sensor_mixgome_eulerangles"></block>
<block type="mini_g2_rfid_status"></block>
<block type="radar_set_DETECTION_THRESHOLD_SANT">
<value name="VAR">
<shadow type="math_number">
<field name="NUM">5000</field>
</shadow>
</value>
<value name="VAR2">
<shadow type="math_number">
<field name="NUM">500</field>
</shadow>
</value>
</block>
<block type="interaction_whether_to_interaction_SANT"></block>
</category>
<category id="catCE_G6" colour="100">
<block type="communicate_i2c_init">
<value name="SUB">
<shadow type="variables_get">
<field name="VAR">i2c_extend</field>
</shadow>
</value>
<value name="TX">
<shadow type="pins_digital_pin">
<field name="PIN">17</field>
</shadow>
</value>
<value name="RX">
<shadow type="pins_digital_pin">
<field name="PIN">18</field>
</shadow>
</value>
<value name="freq">
<shadow type="math_number">
<field name="NUM">400000</field>
</shadow>
</value>
<next>
<block type="pe_g1_use_i2c_init">
<value name="SUB">
<shadow type="variables_get">
<field name="VAR">g6</field>
</shadow>
</value>
<value name="I2CSUB">
<shadow type="variables_get">
<field name="VAR">i2c_extend</field>
</shadow>
</value>
</block>
</next>
</block>
<block type="pe_g1_battery_left">
<value name="SUB">
<shadow type="variables_get">
<field name="VAR">g6</field>
</shadow>
</value>
</block>
<block type="pe_g1_servo_set_angle">
<value name="SUB">
<shadow type="variables_get">
<field name="VAR">g6</field>
</shadow>
</value>
<value name="PIN">
<shadow type="number5">
</shadow>
</value>
<value name="NUM">
<shadow type="math_number">
<field name="NUM">100</field>
</shadow>
</value>
</block>
<block type="pe_g1_servo_get_angle">
<value name="SUB">
<shadow type="variables_get">
<field name="VAR">g6</field>
</shadow>
</value>
<value name="PIN">
<shadow type="number5">
</shadow>
</value>
</block>
<block type="pe_g1_servo_set_speed">
<value name="SUB">
<shadow type="variables_get">
<field name="VAR">g6</field>
</shadow>
</value>
<value name="PIN">
<shadow type="number5">
</shadow>
</value>
<value name="NUM">
<shadow type="math_number">
<field name="NUM">100</field>
</shadow>
</value>
</block>
<block type="pe_g1_servo_get_speed">
<value name="SUB">
<shadow type="variables_get">
<field name="VAR">g6</field>
</shadow>
</value>
<value name="PIN">
<shadow type="number5">
</shadow>
</value>
</block>
<block type="pe_g1_dc_motor">
<value name="SUB">
<shadow type="variables_get">
<field name="VAR">g6</field>
</shadow>
</value>
<value name="PIN">
<shadow type="number4">
</shadow>
</value>
<value name="speed">
<shadow type="math_number">
<field name="NUM">100</field>
</shadow>
</value>
</block>
<block type="pe_g1_dc_motor_speed">
<value name="SUB">
<shadow type="variables_get">
<field name="VAR">g6</field>
</shadow>
</value>
<value name="PIN">
<shadow type="number4">
</shadow>
</value>
</block>
</category> -->
<category id="catIot" colour="#2FAD7A">
<category id="catBlynk" colour="#2FAD7A">
<block type="iot_wifi_connect">
@@ -4054,7 +4000,7 @@
</shadow>
</value>
</block>
<block type="radar_set_DETECTION_THRESHOLD">
<block type="radar_set_DETECTION_THRESHOLD" m-hide='micropython:esp32s3:mixgo_sant'>
<value name="SUB">
<shadow type="variables_get">
<field name="VAR">xsensor</field>
@@ -4071,35 +4017,35 @@
</shadow>
</value>
</block>
<block type="interaction_whether_to_interaction">
<block type="interaction_whether_to_interaction" m-hide='micropython:esp32s3:mixgo_sant'>
<value name="SUB">
<shadow type="variables_get">
<field name="VAR">xsensor</field>
</shadow>
</value>
</block>
<block type="CI130X_IDENTIFY_AND_SAVE">
<block type="CI130X_IDENTIFY_AND_SAVE" m-hide='micropython:esp32s3:mixgo_sant'>
<value name="SUB">
<shadow type="variables_get">
<field name="VAR">xsensor</field>
</shadow>
</value>
</block>
<block type="CI130X_GET_WHETHER_IDENTIFY">
<block type="CI130X_GET_WHETHER_IDENTIFY" m-hide='micropython:esp32s3:mixgo_sant'>
<value name="SUB">
<shadow type="variables_get">
<field name="VAR">xsensor</field>
</shadow>
</value>
</block>
<block type="CI130X_GET_THE_RECOGNIZED_CMD">
<block type="CI130X_GET_THE_RECOGNIZED_CMD" m-hide='micropython:esp32s3:mixgo_sant'>
<value name="SUB">
<shadow type="variables_get">
<field name="VAR">xsensor</field>
</shadow>
</value>
</block>
<block type="CI130X_BROADCAST">
<block type="CI130X_BROADCAST" m-hide='micropython:esp32s3:mixgo_sant'>
<value name="SUB">
<shadow type="variables_get">
<field name="VAR">xsensor</field>
@@ -4109,11 +4055,12 @@
<block type="logic_null"></block>
</value>
</block>
<block type = "CI130X_SET_SYSTEM_CMD">
<block type = "CI130X_SET_SYSTEM_CMD" m-hide='micropython:esp32s3:mixgo_sant'>
<value name="SUB">
<shadow type="variables_get">
<field name="VAR">xsensor</field>
</shadow>
</value>
</block>
<block type="communicate_spi_init">
<value name="VAR">

View File

@@ -34,6 +34,7 @@ En.MSG = {
catCE_G6:"CE G6",
catCC_G1:"CC G1",
catMINI_G2:"MINI G2",
catSANT_G2:"SANT G2",
catNova_G1:"Nova G1",
catAIOT:"Intelligent IOT",
catAIsensor:"MixGoAI Sensor",

View File

@@ -33,6 +33,7 @@ ZhHans.MSG = {
catCE_G6:"CE G6",
catCC_G1:"CC G1",
catMINI_G2:"MINI G2",
catSANT_G2:"SANT G2",
catNova_G1:"Nova G1",
catAIOT:"智能物联",
catAIsensor:"MixGoAI智能传感",

View File

@@ -33,6 +33,7 @@ ZhHant.MSG = {
catCE_G6:"CE G6",
catCC_G1:"CC G1",
catMINI_G2:"MINI G2",
catSANT_G2:"SANT G2",
catNova_G1:"Nova G1",
catAIOT:"智能物聯",
catAIsensor:"MixGoAI智能傳感",