修改块

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,16 @@ 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"]
]), 'PIN');
this.setOutput(true, Number);
}
};

View File

@@ -46,4 +46,5 @@ export const pins_tone_notes = pins_digital;
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 pins_digital_dot = pins_digital;
export const timer_id_pin = pins_digital;

View File

@@ -212,17 +212,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">
@@ -232,7 +229,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>
@@ -1700,6 +1697,13 @@
</block>
<block type="actuator_onboard_neopixel_write">
</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" name="catOnBoardDisplay" colour='#569A98'
m-hide='micropython:esp32c3:generic micropython:esp32c3:mixgocar_c3'>
@@ -1823,8 +1827,13 @@
</block>
<block type="display_clear"></block>
<block type="set_music_volume">
<value name="percent">
<shadow type="math_number">
<field name="NUM">100</field>
</shadow>
</value>
</block>
</category>
<category id="catME_GO" colour="100"
@@ -4537,6 +4546,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>
<category id="catExternMonitor" colour='5BA5A5' m-hide='micropython:esp32c3:mixgocar_c3'>
@@ -6575,6 +6591,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>
@@ -6618,6 +6639,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>