修改块
This commit is contained in:
@@ -1838,3 +1838,16 @@ export const record_audio = {
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const set_music_volume ={
|
||||
init: function () {
|
||||
this.setColour(ACTUATOR_ONBOARD_HUE);
|
||||
this.appendValueInput('percent')
|
||||
.appendField(Blockly.Msg.MIXLY_MUSIC_VOLUME_SET);
|
||||
this.appendDummyInput()
|
||||
.appendField('%');
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
};
|
||||
@@ -195,6 +195,9 @@ export const network_ap_connect = {
|
||||
this.appendValueInput('essid')
|
||||
.setCheck(String)
|
||||
.appendField(Blockly.Msg.MIXLY_NETWORK_WIFI_ESSID);
|
||||
this.appendValueInput('password')
|
||||
.setCheck(String)
|
||||
.appendField(Blockly.Msg.MIXLY_NETWORK_WIFI_ESSID);
|
||||
this.appendValueInput('channel')
|
||||
.setCheck(Number)
|
||||
.appendField(Blockly.Msg.MIXLY_NETWORK_WIFI_CHANNEL);
|
||||
|
||||
@@ -133,6 +133,9 @@ export const timer = {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated To be removed in the future
|
||||
*/
|
||||
export const system_timer = {
|
||||
init: function () {
|
||||
this.setColour(SYSTEM_HUE);
|
||||
@@ -176,6 +179,9 @@ export const system_ticks_diff = {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated To be removed in the future
|
||||
*/
|
||||
export const system_timer_init = {
|
||||
init: function () {
|
||||
this.setColour(SYSTEM_HUE);
|
||||
@@ -190,6 +196,35 @@ export const system_timer_init = {
|
||||
}
|
||||
};
|
||||
|
||||
export const set_system_timer = {
|
||||
init: function () {
|
||||
this.setColour(SYSTEM_HUE);
|
||||
this.appendValueInput('VAR')
|
||||
.appendField("Timer")
|
||||
.setCheck("var")
|
||||
.appendField(Blockly.Msg.MIXLY_SETUP);
|
||||
this.appendValueInput("PIN")
|
||||
.appendField("ID")
|
||||
.setCheck(Number);
|
||||
this.appendValueInput("period")
|
||||
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_MICROBIT_JS_PERIOD_MIL)
|
||||
.setCheck(Number);
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.MIXLY_mSecond)
|
||||
.appendField(Blockly.Msg.MIXLY_MODE)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_PYTHON_ONE_SHOT, "ONE_SHOT"],
|
||||
[Blockly.Msg.MIXLY_PYTHON_PERIODIC, "PERIODIC"]
|
||||
]), "mode");
|
||||
this.appendValueInput('callback')
|
||||
.appendField(Blockly.Msg.MIXLY_DO)
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_SYSTEM_TIMER_TOOLTIP);
|
||||
}
|
||||
};
|
||||
|
||||
export const system_wdt_init = {
|
||||
init: function () {
|
||||
this.setColour(SYSTEM_HUE);
|
||||
|
||||
Reference in New Issue
Block a user