增加两个库的块微波雷达和语音播放
This commit is contained in:
@@ -519,6 +519,124 @@ export const actuator_use_uart_init = {
|
||||
}
|
||||
};
|
||||
|
||||
export const actuator_use_uart_init_player = {
|
||||
init: function () {
|
||||
this.setColour(ACTUATOR_EXTERN_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.CONTROLS_FOR_INPUT_WITH + "uart")
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
["uart1", "uart1"],
|
||||
["uart2", "uart2"]
|
||||
]), "key");
|
||||
this.appendValueInput('SUB')
|
||||
.appendField(Blockly.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE)
|
||||
.setCheck("var");
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.MIXLY_SETUP + Blockly.Msg.LISTS_SET_INDEX_INPUT_TO + 'NS9300' + Blockly.Msg.MIXLY_MUSIC_PLAYER);
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
}
|
||||
};
|
||||
|
||||
export const player_whether_stop ={
|
||||
init:function(){
|
||||
this.setColour(ACTUATOR_EXTERN_HUE);
|
||||
this.appendValueInput('SUB')
|
||||
.appendField(Blockly.Msg.MIXLY_GET + Blockly.Msg.MIXLY_MUSIC_PLAYER)
|
||||
.setCheck("var");
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.MIXLY_WHETHER)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_STOPPED, "0"],
|
||||
[Blockly.Msg.MIXLY_PLAYING, "1"],
|
||||
[Blockly.Msg.MIXLY_PAUSED, "2"]
|
||||
]), "key");
|
||||
this.setInputsInline(true);
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const player_set_play = {
|
||||
init:function(){
|
||||
this.setColour(ACTUATOR_EXTERN_HUE);
|
||||
this.appendValueInput('SUB')
|
||||
.appendField(Blockly.Msg.MIXLY_MUSIC_PLAYER)
|
||||
.setCheck("var");
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.MIXLY_STAT)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_MP3_PLAY, "1"],
|
||||
[Blockly.Msg.MIXLY_MP3_PAUSE, "2"],
|
||||
[Blockly.Msg.MIXLY_STOP, "3"],
|
||||
[Blockly.Msg.MIXLY_MP3_PREV, "4"],
|
||||
[Blockly.Msg.MIXLY_MP3_NEXT, "5"]
|
||||
]), "key");
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const player_set_volume = {
|
||||
init:function(){
|
||||
this.setColour(ACTUATOR_EXTERN_HUE);
|
||||
this.appendValueInput('SUB')
|
||||
.appendField(Blockly.Msg.MIXLY_MUSIC_PLAYER)
|
||||
.setCheck("var");
|
||||
this.appendValueInput('volume')
|
||||
.appendField(Blockly.Msg.MIXLY_MP3_VOL +Blockly.Msg.MIXLY_STAT);
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_PLAYER_SET_VOLUME_TOOLTIP);
|
||||
}
|
||||
}
|
||||
|
||||
export const player_set_mode = {
|
||||
init:function(){
|
||||
this.setColour(ACTUATOR_EXTERN_HUE);
|
||||
this.appendValueInput('SUB')
|
||||
.appendField(Blockly.Msg.MIXLY_MUSIC_PLAYER)
|
||||
.setCheck("var");
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.MIXLY_MODE+Blockly.Msg.MIXLY_STAT)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_MP3_LOOP_ALL, "0"],
|
||||
[Blockly.Msg.MIXLY_MP3_LOOP_ONE, "1"],
|
||||
[Blockly.Msg.MIXLY_PLAYER_DIRECTORY_LOOP, "2"],
|
||||
[Blockly.Msg.MIXLY_MP3_LOOP_RAM, "3"],
|
||||
[Blockly.Msg.MIXLY_PLAYER_SINGLE_STOP, "4"],
|
||||
[Blockly.Msg.MIXLY_PLAYER_SEQUENTIAL_PLAY, "5"]
|
||||
]), "key");
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const player_play_music = {
|
||||
init:function(){
|
||||
this.setColour(ACTUATOR_EXTERN_HUE);
|
||||
this.appendValueInput('SUB')
|
||||
.appendField(Blockly.Msg.MIXLY_MUSIC_PLAYER)
|
||||
.setCheck("var");
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_MICROBIT_JS_START_MELODY,"play"],
|
||||
[Blockly.Msg.MIXLY_PLAYER_INSERT_MUSIC, "insert"]
|
||||
]), "key");
|
||||
this.appendValueInput('song');
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
}
|
||||
}
|
||||
|
||||
export const player_insert_music ={
|
||||
|
||||
}
|
||||
|
||||
export const syn6288_set_voice = {
|
||||
init: function () {
|
||||
this.setColour(ACTUATOR_EXTERN_HUE);
|
||||
|
||||
@@ -366,6 +366,68 @@ export const sensor_use_i2c_init = {
|
||||
}
|
||||
};
|
||||
|
||||
export const radar_use_i2c_init = {
|
||||
init: function () {
|
||||
this.setColour(SENSOR_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 + Blockly.Msg.MIXLY_RADAR)
|
||||
.setCheck("var");
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.MIXLY_SETUP + Blockly.Msg.LISTS_SET_INDEX_INPUT_TO)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
["CBR817", "CBR817"]
|
||||
]), "key");
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
}
|
||||
};
|
||||
|
||||
export const radar_set_DELAY_TIME = {
|
||||
init: function () {
|
||||
this.setColour(SENSOR_EXTERN_HUE);
|
||||
this.appendValueInput('SUB')
|
||||
.appendField(Blockly.Msg.MIXLY_RADAR)
|
||||
.setCheck("var");
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.LISTS_SET_INDEX_SET + Blockly.Msg.MIXlY_INTERACTION+Blockly.Msg.MIXLY_DELAY_TIME);
|
||||
this.appendValueInput('VAR');
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setInputsInline(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_THRESHOLD_TOOLTIP);
|
||||
}
|
||||
};
|
||||
|
||||
export const radar_set_DETECTION_THRESHOLD = {
|
||||
init: function () {
|
||||
this.setColour(SENSOR_EXTERN_HUE);
|
||||
this.appendValueInput('SUB')
|
||||
.appendField(Blockly.Msg.MIXLY_RADAR)
|
||||
.setCheck("var");
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.LISTS_SET_INDEX_SET + Blockly.Msg.MIXlY_INTERACTION+Blockly.Msg.MIXLY_DETECTION_THRESHOLD)
|
||||
this.appendValueInput('VAR');
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setInputsInline(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_DELAY_TIME_RANGE);
|
||||
}
|
||||
};
|
||||
|
||||
export const interaction_whether_to_interaction = {
|
||||
init:function(){
|
||||
this.setColour(SENSOR_EXTERN_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.MIXLY_RADAR + Blockly.Msg.MIXLY_GET_TO_INTERACTION)
|
||||
this.setOutput(true);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const sensor_MAX30102_extern = {
|
||||
init: function () {
|
||||
this.setColour(SENSOR_EXTERN_HUE);
|
||||
|
||||
Reference in New Issue
Block a user