修改块

This commit is contained in:
Irene-Maxine
2025-08-01 22:50:05 +08:00
parent f75141b3bb
commit a632268f60
26 changed files with 343 additions and 65 deletions

View File

@@ -398,4 +398,18 @@ export const pins_digital_dot = {
.appendField(new Blockly.FieldDropdown(Profile.default.digital_dot), 'PIN');
this.setOutput(true, Number);
}
};
export const timer_id_pin = {
init: function () {
this.setColour(PINS_HUE);
this.appendDummyInput("")
.appendField(new Blockly.FieldDropdown([
["0","0"],
["1","1"],
["2","2"],
["3","3"]
]), 'PIN');
this.setOutput(true, Number);
}
};

View File

@@ -46,6 +46,7 @@ export const pins_radio_power = pins_digital;
export const pins_radio_datarate = pins_digital;
export const pins_one_more = pins_digital;
export const pins_digital_dot = pins_digital;
export const timer_id_pin = pins_digital;
export const pins_builtinimg = function (_, generator) {
const PIN_VALUE = this.getFieldValue('PIN');

View File

@@ -237,17 +237,14 @@
</block>
</statement>
</block>
<block type="system_timer_init">
<value name="SUB">
<block type="set_system_timer">
<value name="VAR">
<shadow type="variables_get">
<field name="VAR">tim</field>
</shadow>
</value>
</block>
<block type="system_timer">
<value name="VAR">
<shadow type="variables_get">
<field name="VAR">tim</field>
<value name="PIN">
<shadow type="timer_id_pin">
</shadow>
</value>
<value name="period">
@@ -257,7 +254,7 @@
</value>
<value name="callback">
<shadow type="factory_block_return">
<field name="VALUE">tim_callback</field>
<field name="VALUE">tim_6</field>
</shadow>
</value>
</block>
@@ -1826,6 +1823,13 @@
</shadow>
</value>
</block>
<block type="set_music_volume">
<value name="percent">
<shadow type="math_number">
<field name="NUM">100</field>
</shadow>
</value>
</block>
</category>
<category id="catOnBoardDisplay" colour='#78B5B4' m-hide='micropython:esp32s3:generic'>
<block type="display_image_builtins_all"></block>
@@ -4997,6 +5001,20 @@
</shadow>
</value>
</block>
<block type="set_music_volume">
<value name="percent">
<shadow type="math_number">
<field name="NUM">100</field>
</shadow>
</value>
</block>
<block type="set_music_volume">
<value name="percent">
<shadow type="math_number">
<field name="NUM">100</field>
</shadow>
</value>
</block>
</category>
</category>
<category id="catNova_G1" colour='100' m-show="micropython:esp32s3:mixgo_nova">
@@ -7058,6 +7076,11 @@
<field name="TEXT">127.16.0.8</field>
</shadow>
</value>
<value name="password">
<shadow type="text">
<field name="TEXT">123456</field>
</shadow>
</value>
<value name="channel">
<shadow type="math_number">
<field name="NUM">1</field>
@@ -7101,6 +7124,11 @@
<field name="TEXT">SmallCabbage</field>
</shadow>
</value>
<value name="password">
<shadow type="text">
<field name="TEXT">123456</field>
</shadow>
</value>
<value name="channel">
<shadow type="math_number">
<field name="NUM">1</field>