update generated code

This commit is contained in:
Mario Pesch 2022-01-29 10:50:30 +01:00
parent 0c8ae90124
commit c711596285
3 changed files with 38 additions and 21 deletions

View File

@ -108,3 +108,14 @@ Blockly.Blocks["sensebox_ethernet"] = {
} }
}, },
}; };
Blockly.Blocks["sensebox_ethernetIp"] = {
init: function () {
this.appendDummyInput().appendField(Blockly.Msg.senseBox_ethernet_ip);
this.setColour(getColour().sensebox);
this.setHelpUrl(Blockly.Msg.senseBox_ethernetIp_helpurl);
this.setTooltip(Blockly.Msg.senseBox_ethernet_ip_tooltip);
this.setOutput(true, null);
},
};

View File

@ -74,3 +74,8 @@ Blockly.Arduino.sensebox_ethernet = function () {
var code = ""; var code = "";
return code; return code;
}; };
Blockly.Arduino.sensebox_ethernetIp = function () {
var code = "Ethernet.localIP()";
return [code, Blockly.Arduino.ORDER_ATOMIC];
};

View File

@ -94,8 +94,9 @@ class Toolbox extends React.Component {
<Block type="sensebox_wifi" /> <Block type="sensebox_wifi" />
<Block type="sensebox_startap" /> <Block type="sensebox_startap" />
</Category> </Category>
<Category name="Misc" colour={getColour().sensebox}> <Category name="Ethernet" colour={getColour().sensebox}>
<Block type="sensebox_ethernet" /> <Block type="sensebox_ethernet" />
<Block type="sensebox_ethernetIp" />
</Category> </Category>
<Category name="SD" colour={getColour().sensebox}> <Category name="SD" colour={getColour().sensebox}>
<Block type="sensebox_sd_create_file" /> <Block type="sensebox_sd_create_file" />