feat(boards): 所有micropython esp板卡加入 PE GX 类别

This commit is contained in:
王立帮
2026-01-13 15:09:06 +08:00
parent 583b82452a
commit a5fa5034f9
20 changed files with 1059 additions and 394 deletions

View File

@@ -1,13 +1,9 @@
import * as Blockly from 'blockly/core';
import * as Mixly from 'mixly';
const PEG1_HUE = 100;
export const pe_g1_use_i2c_init = {
init: function () {
var version = Mixly.Boards.getSelectedBoardKey().split(':')[2];
if (version == "mixgo_ce") { var name = 'CE G6' }
else if (version == "mixgo_pe") { var name = 'PE G1' }
this.setColour(PEG1_HUE);
this.appendValueInput('I2CSUB')
.appendField(Blockly.Msg.CONTROLS_FOR_INPUT_WITH + "I2C")
@@ -17,7 +13,7 @@ export const pe_g1_use_i2c_init = {
.setCheck("var");
this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_SETUP + Blockly.Msg.LISTS_SET_INDEX_INPUT_TO)
.appendField(name);
.appendField('PE GX');
this.setInputsInline(true);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
@@ -26,12 +22,9 @@ export const pe_g1_use_i2c_init = {
export const pe_g1_battery_left = {
init: function () {
var version = Mixly.Boards.getSelectedBoardKey().split(':')[2];
if (version == "mixgo_ce") { var name = 'CE G6' }
else if (version == "mixgo_pe") { var name = 'PE G1' }
this.setColour(PEG1_HUE);
this.appendValueInput('SUB')
.appendField(name)
.appendField('PE GX')
.setCheck("var");
this.appendDummyInput()
.appendField(Blockly.Msg.MIXLY_MIXGO_CAR_BATTERY_LEFT);
@@ -42,12 +35,9 @@ export const pe_g1_battery_left = {
export const pe_g1_dc_motor = {
init: function () {
var version = Mixly.Boards.getSelectedBoardKey().split(':')[2];
if (version == "mixgo_ce") { var name = 'CE G6' }
else if (version == "mixgo_pe") { var name = 'PE G1' }
this.setColour(PEG1_HUE);
this.appendValueInput('SUB')
.appendField(name)
.appendField('PE GX')
.setCheck("var");
this.appendValueInput('PIN')
.appendField(Blockly.Msg.MOTOR_DC)
@@ -74,12 +64,9 @@ export const pe_g1_dc_motor = {
export const pe_g1_dc_motor_speed = {
init: function () {
var version = Mixly.Boards.getSelectedBoardKey().split(':')[2];
if (version == "mixgo_ce") { var name = 'CE G6' }
else if (version == "mixgo_pe") { var name = 'PE G1' }
this.setColour(PEG1_HUE);
this.appendValueInput('SUB')
.appendField(name)
.appendField('PE GX')
.setCheck("var");
this.appendValueInput('PIN')
.appendField(Blockly.Msg.MOTOR_DC)
@@ -94,12 +81,9 @@ export const pe_g1_dc_motor_speed = {
export const pe_g1_servo_set_angle = {
init: function () {
var version = Mixly.Boards.getSelectedBoardKey().split(':')[2];
if (version == "mixgo_ce") { var name = 'CE G6' }
else if (version == "mixgo_pe") { var name = 'PE G1' }
this.setColour(PEG1_HUE);
this.appendValueInput('SUB')
.appendField(name)
.appendField('PE GX')
.setCheck("var");
this.appendValueInput('PIN')
.appendField('180°' + Blockly.Msg.MIXLY_SERVO)
@@ -118,12 +102,9 @@ export const pe_g1_servo_set_angle = {
export const pe_g1_servo_set_speed = {
init: function () {
var version = Mixly.Boards.getSelectedBoardKey().split(':')[2];
if (version == "mixgo_ce") { var name = 'CE G6' }
else if (version == "mixgo_pe") { var name = 'PE G1' }
this.setColour(PEG1_HUE);
this.appendValueInput('SUB')
.appendField(name)
.appendField('PE GX')
.setCheck("var");
this.appendValueInput('PIN')
.appendField('360°' + Blockly.Msg.MIXLY_SERVO)
@@ -144,12 +125,9 @@ export const pe_g1_servo_set_speed = {
export const pe_g1_servo_get_angle = {
init: function () {
var version = Mixly.Boards.getSelectedBoardKey().split(':')[2];
if (version == "mixgo_ce") { var name = 'CE G6' }
else if (version == "mixgo_pe") { var name = 'PE G1' }
this.setColour(PEG1_HUE);
this.appendValueInput('SUB')
.appendField(name)
.appendField('PE GX')
.setCheck("var");
this.appendValueInput('PIN')
.appendField('180°' + Blockly.Msg.MIXLY_SERVO)
@@ -163,12 +141,9 @@ export const pe_g1_servo_get_angle = {
export const pe_g1_servo_get_speed = {
init: function () {
var version = Mixly.Boards.getSelectedBoardKey().split(':')[2];
if (version == "mixgo_ce") { var name = 'CE G6' }
else if (version == "mixgo_pe") { var name = 'PE G1' }
this.setColour(PEG1_HUE);
this.appendValueInput('SUB')
.appendField(name)
.appendField('PE GX')
.setCheck("var");
this.appendValueInput('PIN')
.appendField('360°' + Blockly.Msg.MIXLY_SERVO)

View File

@@ -361,7 +361,9 @@ export const number5 = {
["0", "0"],
["1", "1"],
["2", "2"],
["3", "3"]
["3", "3"],
["4", "4"],
["5", "5"]
]), 'op')
this.setOutput(true);
this.setTooltip(Blockly.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW);