feat(boards): 添加 micropython_esp32c5 板卡
This commit is contained in:
@@ -970,6 +970,10 @@ export const set_power_output = {
|
||||
this.appendDummyInput()
|
||||
.appendField(new Blockly.FieldDropdown([["1", "1"], ["2", "2"]]), "index");
|
||||
break;
|
||||
case 'micropython:esp32c5:mixgo_sowl':
|
||||
this.appendDummyInput()
|
||||
.appendField(new Blockly.FieldDropdown([["1", "1"], ["2", "2"], ["4", "4"], ["5", "5"]]), "index");
|
||||
break;
|
||||
default:
|
||||
this.appendDummyInput()
|
||||
.appendField(new Blockly.FieldDropdown([["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"]]), "index");
|
||||
@@ -999,6 +1003,10 @@ export const get_power_output = {
|
||||
this.appendDummyInput()
|
||||
.appendField(new Blockly.FieldDropdown([["1", "1"], ["2", "2"]]), "index");
|
||||
break;
|
||||
case 'micropython:esp32c5:mixgo_sowl':
|
||||
this.appendDummyInput()
|
||||
.appendField(new Blockly.FieldDropdown([["1", "1"], ["2", "2"], ["4", "4"], ["5", "5"]]), "index");
|
||||
break;
|
||||
default:
|
||||
this.appendDummyInput()
|
||||
.appendField(new Blockly.FieldDropdown([["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"]]), "index");
|
||||
@@ -1030,6 +1038,25 @@ export const set_all_power_output = {
|
||||
}
|
||||
}
|
||||
|
||||
export const set_part_power_output = {
|
||||
init: function () {
|
||||
this.setColour(ACTUATOR_ONBOARD_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.LISTS_SET_INDEX_SET + Blockly.Msg.ME_GO_MOTOR_EXTERN)
|
||||
.appendField(new Blockly.FieldDropdown([["1-2", "1"], ["4-5", "4"]]), "index");
|
||||
this.appendValueInput('duty')
|
||||
.setCheck(Number)
|
||||
.setAlign(Blockly.ALIGN_RIGHT)
|
||||
.appendField(Blockly.Msg.blynk_IOT_IR_POWER + Blockly.Msg.MIXLY_PINMODEOUT + Blockly.Msg.MIXLY_FREQUENCY);
|
||||
this.appendDummyInput()
|
||||
.appendField('Hz')
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setInputsInline(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP);
|
||||
}
|
||||
}
|
||||
|
||||
export const analog_keyboard_input = {
|
||||
init: function () {
|
||||
this.setColour(ACTUATOR_ONBOARD_HUE);
|
||||
|
||||
@@ -511,6 +511,15 @@ export const set_all_power_output = function (_, generator) {
|
||||
return code;
|
||||
}
|
||||
|
||||
export const set_part_power_output = function (_, generator) {
|
||||
var version = Boards.getSelectedBoardKey().split(':')[2];
|
||||
var index = this.getFieldValue('index');
|
||||
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(' + index + ', freq=' + duty + ')\n';
|
||||
return code;
|
||||
}
|
||||
|
||||
export const analog_keyboard_input = function (_, generator) {
|
||||
var version = Boards.getSelectedBoardKey().split(':')[2]
|
||||
var sp = generator.valueToCode(this, 'special', generator.ORDER_ATOMIC);
|
||||
|
||||
Reference in New Issue
Block a user