修改外接四位数码屏、新增mini板载执行 麦克风

This commit is contained in:
Irene-Maxine
2025-07-24 00:27:20 +08:00
parent 51277dc273
commit 9cce2e9a0b
13 changed files with 129 additions and 149 deletions

View File

@@ -1806,4 +1806,35 @@ export const get_keyboard_light = {
this.setOutput(true);
this.setInputsInline(true);
}
};
};
export const set_microphone_amplification = {
init: function () {
this.setColour(ACTUATOR_ONBOARD_HUE);
this.appendDummyInput()
.appendField(Blockly.Msg.LISTS_SET_INDEX_SET + Blockly.Msg.MIXLY_MICROPHONE_AMPLIFICATION)
this.appendDummyInput()
.appendField(new Blockly.FieldDropdown([
['4x', "0"],
['8x', "1"],
['16x', "2"],
['32x', "3"]
]), 'times');
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setInputsInline(true);
}
};
export const record_audio = {
init: function () {
this.setColour(ACTUATOR_ONBOARD_HUE);
this.appendValueInput('str')
.appendField(Blockly.Msg.MIXPY_AI_AUDIO);
this.appendValueInput('time')
.appendField(Blockly.Msg.MIXPY_AI_AUDIO_TIME);
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setInputsInline(true);
}
};

View File

@@ -837,9 +837,6 @@ export const display_oled_drawPixel = {
export const display_tm_use_i2c_init = {
init: function () {
this.setColour(DISPLAY_EXTERN_HUE);
// this.appendValueInput('I2CSUB')
// .appendField(Blockly.Msg.CONTROLS_FOR_INPUT_WITH + "I2C")
// .setCheck("var");
this.appendValueInput('SUB')
.appendField(Blockly.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE)
.setCheck("var");
@@ -850,6 +847,10 @@ export const display_tm_use_i2c_init = {
["TM1650", "TM1650"],
["TM1637", "TM1637"]
]), "key");
this.appendValueInput('CLK')
.appendField('CLK#');
this.appendValueInput('DIO')
.appendField('DIO#');
this.setInputsInline(true);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
@@ -892,7 +893,7 @@ export const display_tm1650_show_num = {
this.setColour(DISPLAY_EXTERN_HUE);
this.appendDummyInput()
.appendField(Blockly.Msg.MIXLY_4DIGITDISPLAY)
.appendField(new Blockly.FieldDropdown([["TM1650", "tm1650"]]), "TYPE");
.appendField(new Blockly.FieldDropdown([["TM1650", "tm1650"],["TM1637", "TM1637"]]), "TYPE");
this.appendValueInput("VAR")
this.appendValueInput("VALUE")
.setAlign(Blockly.inputs.Align.RIGHT)
@@ -909,7 +910,7 @@ export const display_tm1650_show_dot = {
this.setColour(DISPLAY_EXTERN_HUE);
this.appendDummyInput()
.appendField(Blockly.Msg.MIXLY_4DIGITDISPLAY)
.appendField(new Blockly.FieldDropdown([["TM1650", "tm1650"]]), "TYPE");
.appendField(new Blockly.FieldDropdown([["TM1650", "tm1650"],["TM1637", "TM1637"]]), "TYPE");
this.appendValueInput("VAR")
this.appendValueInput("NO")
.appendField(Blockly.Msg.MIXLY_4DIGITDISPLAY_NOMBER1)
@@ -927,7 +928,7 @@ export const display_tm1650_set_brightness = {
this.setColour(DISPLAY_EXTERN_HUE);
this.appendDummyInput()
.appendField(Blockly.Msg.MIXLY_4DIGITDISPLAY)
.appendField(new Blockly.FieldDropdown([["TM1650", "tm1650"]]), "TYPE");
.appendField(new Blockly.FieldDropdown([["TM1650", "tm1650"],["TM1637", "TM1637"]]), "TYPE");
this.appendValueInput("VAR")
this.appendValueInput("VALUE")
.setAlign(Blockly.inputs.Align.RIGHT)