Merge pull request #143 from sensebox/block/add-ethernet-bee
Block/add ethernet bee
This commit is contained in:
commit
df9abdc826
@ -22,6 +22,7 @@ import "./serial";
|
||||
import "./time";
|
||||
import "./variables";
|
||||
import "./lists";
|
||||
import "./watchdog";
|
||||
import "./webserver";
|
||||
|
||||
import "../helpers/types";
|
||||
|
@ -49,10 +49,10 @@ Blockly.Blocks["sensebox_display_printDisplay"] = {
|
||||
.appendField(new FieldSlider(1, 1, 4), "SIZE");
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.senseBox_display_printDisplay_x)
|
||||
.appendField(new FieldSlider(0, 0, 128), "X");
|
||||
.appendField(new FieldSlider(0, 0, 127), "X");
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.senseBox_display_printDisplay_y)
|
||||
.appendField(new FieldSlider(0, 0, 64), "Y");
|
||||
.appendField(new FieldSlider(0, 0, 63), "Y");
|
||||
this.appendValueInput("printDisplay")
|
||||
.appendField(Blockly.Msg.senseBox_display_printDisplay_value)
|
||||
.setCheck(null);
|
||||
|
@ -13,13 +13,19 @@ var selectedBox = "";
|
||||
|
||||
Blockly.Blocks["sensebox_osem_connection"] = {
|
||||
init: function () {
|
||||
var ssl = "TRUE";
|
||||
var workspace = Blockly.getMainWorkspace();
|
||||
if (workspace.getBlocksByType("sensebox_ethernet").length > 0) {
|
||||
ssl = "FALSE";
|
||||
console.log("ethernet");
|
||||
}
|
||||
this.setTooltip(Blockly.Msg.senseBox_osem_connection_tip);
|
||||
this.setHelpUrl("");
|
||||
this.setColour(getColour().sensebox);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.senseBox_osem_connection)
|
||||
.appendField("SSL")
|
||||
.appendField(new Blockly.FieldCheckbox("TRUE"), "SSL");
|
||||
.appendField(new Blockly.FieldCheckbox(ssl), "SSL");
|
||||
this.appendDummyInput()
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.senseBox_osem_exposure)
|
||||
@ -94,7 +100,6 @@ Blockly.Blocks["sensebox_osem_connection"] = {
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
updateShape_(isMobile) {
|
||||
if (isMobile) {
|
||||
if (this.getInput("lat") == null) {
|
||||
@ -119,33 +124,6 @@ Blockly.Blocks["sensebox_osem_connection"] = {
|
||||
this.removeInput("timeStamp", true);
|
||||
}
|
||||
},
|
||||
|
||||
// updateShape_: function () {
|
||||
// var extraFieldExist = this.getFieldValue("gps");
|
||||
// var input = this.getFieldValue("type");
|
||||
// if (input === "Mobile" && extraFieldExist === null) {
|
||||
// this.appendValueInput("lat", "Number").appendField(
|
||||
// Blockly.Msg.senseBox_gps_lat,
|
||||
// "gps"
|
||||
// );
|
||||
// this.appendValueInput("lng", "Number").appendField(
|
||||
// Blockly.Msg.senseBox_gps_lng
|
||||
// );
|
||||
// this.appendValueInput("altitude", "Number").appendField(
|
||||
// Blockly.Msg.senseBox_gps_alt
|
||||
// );
|
||||
// this.appendValueInput("timeStamp", "Number").appendField(
|
||||
// Blockly.Msg.senseBox_gps_timeStamp
|
||||
// );
|
||||
// }
|
||||
|
||||
// if (input === "Stationary" && extraFieldExist !== null) {
|
||||
// this.removeInput("lat");
|
||||
// this.removeInput("lng");
|
||||
// this.removeInput("altitude");
|
||||
// this.removeInput("timeStamp");
|
||||
// }
|
||||
// },
|
||||
LOOP_TYPES: ["sensebox_interval_timer"],
|
||||
};
|
||||
Blockly.Blocks["sensebox_send_to_osem"] = {
|
||||
|
@ -40,6 +40,87 @@ Blockly.Blocks["sensebox_wifi"] = {
|
||||
LOOP_TYPES: ["arduino_functions"],
|
||||
};
|
||||
|
||||
Blockly.Blocks["sensebox_startap"] = {
|
||||
init: function () {
|
||||
this.setTooltip(Blockly.Msg.senseBox_wifi_startap_tooltip);
|
||||
this.setHelpUrl("");
|
||||
this.setColour(getColour().sensebox);
|
||||
this.appendDummyInput().appendField(Blockly.Msg.senseBox_wifi_startap);
|
||||
this.appendDummyInput()
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.senseBox_wifi_ssid)
|
||||
.appendField(new Blockly.FieldTextInput("SSID"), "SSID");
|
||||
this.setHelpUrl(Blockly.Msg.senseBox_wifi_helpurl);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
},
|
||||
};
|
||||
|
||||
Blockly.Blocks["sensebox_ethernet"] = {
|
||||
init: function () {
|
||||
this.setTooltip(Blockly.Msg.senseBox_ethernet_tooltip);
|
||||
this.setHelpUrl("");
|
||||
this.setColour(getColour().sensebox);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.senseBox_ethernet)
|
||||
.appendField(
|
||||
new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.senseBox_ethernet_dhcp, "Dhcp"],
|
||||
[Blockly.Msg.senseBox_ethernet_manuel_config, "Manual"],
|
||||
]),
|
||||
"dhcp"
|
||||
);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.senseBox_ethernet_mac)
|
||||
.appendField(
|
||||
new Blockly.FieldTextInput("0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED"),
|
||||
"mac"
|
||||
);
|
||||
|
||||
this.setHelpUrl(Blockly.Msg.senseBox_ethernet_helpurl);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.getField("dhcp").setValidator(
|
||||
function (val) {
|
||||
this.updateShape_(val === "Manual");
|
||||
}.bind(this)
|
||||
);
|
||||
},
|
||||
|
||||
updateShape_(isManual) {
|
||||
if (isManual) {
|
||||
this.appendDummyInput("ip-field")
|
||||
.appendField(Blockly.Msg.senseBox_ethernet_ip)
|
||||
.appendField(new Blockly.FieldTextInput("192.168.1.100"), "ip");
|
||||
this.appendDummyInput("subnetmask-field")
|
||||
.appendField(Blockly.Msg.senseBox_ethernet_subnetmask)
|
||||
.appendField(new Blockly.FieldTextInput("255.255.255.0"), "subnetmask");
|
||||
this.appendDummyInput("gateway-field")
|
||||
.appendField(Blockly.Msg.senseBox_ethernet_gateway)
|
||||
.appendField(new Blockly.FieldTextInput("192.168.1.1"), "gateway");
|
||||
this.appendDummyInput("dns-field")
|
||||
.appendField(Blockly.Msg.senseBox_ethernet_dns)
|
||||
.appendField(new Blockly.FieldTextInput("8.8.8.8"), "dns");
|
||||
} else {
|
||||
this.removeInput("ip-field", true);
|
||||
this.removeInput("subnetmask-field", true);
|
||||
this.removeInput("gateway-field", true);
|
||||
this.removeInput("dns-field", true);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
||||
Blockly.Blocks["sensebox_wifi_status"] = {
|
||||
init: function () {
|
||||
this.setTooltip(Blockly.Msg.senseBox_wifi_status_tooltip);
|
||||
@ -70,18 +151,3 @@ Blockly.Blocks["sensebox_wifi_rssi"] = {
|
||||
},
|
||||
};
|
||||
|
||||
Blockly.Blocks["sensebox_startap"] = {
|
||||
init: function () {
|
||||
this.setTooltip(Blockly.Msg.senseBox_wifi_startap_tooltip);
|
||||
this.setHelpUrl("");
|
||||
this.setColour(getColour().sensebox);
|
||||
this.appendDummyInput().appendField(Blockly.Msg.senseBox_wifi_startap);
|
||||
this.appendDummyInput()
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.senseBox_wifi_ssid)
|
||||
.appendField(new Blockly.FieldTextInput("SSID"), "SSID");
|
||||
this.setHelpUrl(Blockly.Msg.senseBox_wifi_helpurl);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
},
|
||||
};
|
||||
|
28
src/components/Blockly/blocks/watchdog.js
Normal file
28
src/components/Blockly/blocks/watchdog.js
Normal file
@ -0,0 +1,28 @@
|
||||
import Blockly from "blockly/core";
|
||||
import { getColour } from "../helpers/colour";
|
||||
|
||||
Blockly.Blocks["watchdog_enable"] = {
|
||||
init: function () {
|
||||
this.appendDummyInput()
|
||||
.appendField("Watchdog aktivieren")
|
||||
.appendField(new Blockly.FieldTextInput("10000"), "TIME")
|
||||
.appendField("ms");
|
||||
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setColour(getColour().io);
|
||||
this.setTooltip("");
|
||||
this.setHelpUrl("");
|
||||
},
|
||||
};
|
||||
|
||||
Blockly.Blocks["watchdog_reset"] = {
|
||||
init: function () {
|
||||
this.appendDummyInput().appendField("Watchdog zurücksetzen");
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setColour(getColour().io);
|
||||
this.setTooltip("");
|
||||
this.setHelpUrl("");
|
||||
},
|
||||
};
|
@ -23,4 +23,5 @@ import "./serial";
|
||||
import "./time";
|
||||
import "./variables";
|
||||
import "./lists";
|
||||
import "./watchdog";
|
||||
import "./webserver";
|
||||
|
@ -17,6 +17,16 @@ Blockly.Arduino.sensebox_send_to_osem = function (block) {
|
||||
};
|
||||
|
||||
Blockly.Arduino.sensebox_osem_connection = function (Block) {
|
||||
var workspace = Blockly.getMainWorkspace();
|
||||
var wifi = false;
|
||||
var ethernet = false;
|
||||
if (workspace.getBlocksByType("sensebox_wifi").length > 0) {
|
||||
wifi = true;
|
||||
ethernet = false;
|
||||
} else if (workspace.getBlocksByType("sensebox_ethernet").length > 0) {
|
||||
ethernet = true;
|
||||
wifi = false;
|
||||
}
|
||||
var box_id = this.getFieldValue("BoxID");
|
||||
var branch = Blockly.Arduino.statementToCode(Block, "DO");
|
||||
var access_token = this.getFieldValue("access_token");
|
||||
@ -41,6 +51,23 @@ Blockly.Arduino.sensebox_osem_connection = function (Block) {
|
||||
Blockly.Arduino.definitions_["SenseBoxID"] =
|
||||
'const char SENSEBOX_ID [] PROGMEM = "' + box_id + '";';
|
||||
Blockly.Arduino.definitions_["host"] =
|
||||
"const char server [] PROGMEM =" + host + ";";
|
||||
if (wifi === true) {
|
||||
if (ssl === "TRUE") {
|
||||
Blockly.Arduino.definitions_["WiFiSSLClient"] = "WiFiSSLClient client;";
|
||||
port = 443;
|
||||
} else if (ssl === "FALSE") {
|
||||
Blockly.Arduino.definitions_["WiFiClient"] = "WiFiClient client;";
|
||||
port = 80;
|
||||
}
|
||||
} else if (ethernet === true) {
|
||||
if (ssl === "TRUE") {
|
||||
Blockly.Arduino.definitions_["WiFiSSLClient"] = "WiFiSSLClient client;";
|
||||
port = 443;
|
||||
} else if (ssl === "FALSE") {
|
||||
Blockly.Arduino.definitions_["EthernetClient"] = "EthernetClient client;";
|
||||
port = 80;
|
||||
}
|
||||
'const char server [] PROGMEM ="ingress.opensensemap.org";';
|
||||
if (ssl === "TRUE") {
|
||||
Blockly.Arduino.libraries_["library_bearSSL"] =
|
||||
@ -220,7 +247,7 @@ Blockly.Arduino.sensebox_osem_connection = function (Block) {
|
||||
lat +
|
||||
"/float(10000000)),(" +
|
||||
lng +
|
||||
"/float(10000000),(" +
|
||||
"/float(10000000)),(" +
|
||||
altitude +
|
||||
"/float(100))," +
|
||||
timestamp +
|
||||
|
@ -14,19 +14,22 @@ Blockly.Arduino.sensebox_rtc_set = function () {
|
||||
Blockly.Arduino.valueToCode(this, "second", Blockly.Arduino.ORDER_ATOMIC) ||
|
||||
"0";
|
||||
var minutes =
|
||||
Blockly.Arduino.valueToCode(this, "second", Blockly.Arduino.ORDER_ATOMIC) ||
|
||||
"0";
|
||||
Blockly.Arduino.valueToCode(
|
||||
this,
|
||||
"minutes",
|
||||
Blockly.Arduino.ORDER_ATOMIC
|
||||
) || "0";
|
||||
var hour =
|
||||
Blockly.Arduino.valueToCode(this, "second", Blockly.Arduino.ORDER_ATOMIC) ||
|
||||
Blockly.Arduino.valueToCode(this, "hour", Blockly.Arduino.ORDER_ATOMIC) ||
|
||||
"0";
|
||||
var day =
|
||||
Blockly.Arduino.valueToCode(this, "second", Blockly.Arduino.ORDER_ATOMIC) ||
|
||||
Blockly.Arduino.valueToCode(this, "day", Blockly.Arduino.ORDER_ATOMIC) ||
|
||||
"0";
|
||||
var month =
|
||||
Blockly.Arduino.valueToCode(this, "second", Blockly.Arduino.ORDER_ATOMIC) ||
|
||||
Blockly.Arduino.valueToCode(this, "month", Blockly.Arduino.ORDER_ATOMIC) ||
|
||||
"0";
|
||||
var year =
|
||||
Blockly.Arduino.valueToCode(this, "second", Blockly.Arduino.ORDER_ATOMIC) ||
|
||||
Blockly.Arduino.valueToCode(this, "year", Blockly.Arduino.ORDER_ATOMIC) ||
|
||||
"0";
|
||||
Blockly.Arduino.libraries_["RV8523"] = `#include <RV8523.h>`;
|
||||
Blockly.Arduino.setupCode_["rtc.start"] = `rtc.start();`;
|
||||
|
@ -162,15 +162,15 @@ void addMeasurement(const char *sensorId, float value) {
|
||||
}
|
||||
`;
|
||||
Blockly.Arduino.functionNames_["writeMeasurementsToSdCard"] = `
|
||||
void writeMeasurementsToSdCard(char* timeStamp, uint32_t latitudes, uint32_t longitudes) {
|
||||
void writeMeasurementsToSdCard(char* timeStamp, int32_t latitudes, int32_t longitudes) {
|
||||
// iterate throug the measurements array
|
||||
for (uint8_t i = 0; i < num_measurements; i++) {
|
||||
char lng[20];
|
||||
char lat[20];
|
||||
float longitude = longitudes / (float)10000000;
|
||||
float latitude = latitudes / (float)10000000;
|
||||
dtostrf(longitude, 2, 7, lng);
|
||||
dtostrf(latitude, 1, 7, lat);
|
||||
dtostrf(longitude, 8, 7, lng);
|
||||
dtostrf(latitude, 8, 7, lat);
|
||||
sprintf_P(buffer, PSTR("%s,%9.2f,%s,%02s,%02s"), measurements[i].sensorId, measurements[i].value, timeStamp, lng, lat);
|
||||
// transmit buffer to client
|
||||
${filename}.println(buffer);
|
||||
|
@ -58,3 +58,57 @@ Blockly.Arduino.sensebox_startap = function (block) {
|
||||
var code = "";
|
||||
return code;
|
||||
};
|
||||
|
||||
|
||||
Blockly.Arduino.sensebox_ethernet = function () {
|
||||
var ip = this.getFieldValue("ip");
|
||||
var gateway = this.getFieldValue("gateway");
|
||||
var subnetmask = this.getFieldValue("subnetmask");
|
||||
var dns = this.getFieldValue("dns");
|
||||
var mac = this.getFieldValue("mac");
|
||||
var dhcp = this.getFieldValue("dhcp");
|
||||
|
||||
Blockly.Arduino.libraries_["library_senseBoxMCU"] =
|
||||
'#include "SenseBoxMCU.h"';
|
||||
Blockly.Arduino.libraries_["library_ethernet"] = "#include <Ethernet.h>";
|
||||
|
||||
Blockly.Arduino.definitions_["ethernet_config"] = `
|
||||
byte mac[] = { ${mac}};`;
|
||||
if (dhcp === "Manual") {
|
||||
Blockly.Arduino.definitions_["ethernet_manual_config"] = `
|
||||
//Configure static IP setup (only needed if DHCP is disabled)
|
||||
IPAddress myIp(${ip.replaceAll(".", ", ")});
|
||||
IPAddress myDns(${dns.replaceAll(".", ",")});
|
||||
IPAddress myGateway(${gateway.replaceAll(".", ",")});
|
||||
IPAddress mySubnet(${subnetmask.replaceAll(".", ",")});
|
||||
`;
|
||||
Blockly.Arduino.setupCode_["ethernet_setup"] = `
|
||||
Ethernet.init(23);
|
||||
// start the Ethernet connection:
|
||||
if (Ethernet.begin(mac) == 0) {
|
||||
// no point in carrying on, so do nothing forevermore:
|
||||
// try to congifure using IP address instead of DHCP:
|
||||
Ethernet.begin(mac, myIp);
|
||||
}
|
||||
// give the Ethernet shield a second to initialize:
|
||||
delay(1000);
|
||||
`;
|
||||
} else {
|
||||
Blockly.Arduino.setupCode_["ethernet_setup"] = `
|
||||
Ethernet.init(23);
|
||||
// start the Ethernet connection:
|
||||
Ethernet.begin(mac);
|
||||
// give the Ethernet shield a second to initialize:
|
||||
delay(1000);
|
||||
`;
|
||||
}
|
||||
|
||||
var code = "";
|
||||
return code;
|
||||
};
|
||||
|
||||
Blockly.Arduino.sensebox_ethernetIp = function () {
|
||||
var code = "Ethernet.localIP()";
|
||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
||||
};
|
||||
|
||||
|
16
src/components/Blockly/generator/watchdog.js
Normal file
16
src/components/Blockly/generator/watchdog.js
Normal file
@ -0,0 +1,16 @@
|
||||
import * as Blockly from "blockly/core";
|
||||
|
||||
Blockly.Arduino.watchdog_enable = function () {
|
||||
var time = this.getFieldValue("TIME");
|
||||
|
||||
Blockly.Arduino.libraries_["Adafruit_sleepydog"] =
|
||||
"#include <Adafruit_SleepyDog.h>";
|
||||
Blockly.Arduino.setupCode_["watchdog_enable"] = `Watchdog.enable(${time});`;
|
||||
var code = "";
|
||||
return code;
|
||||
};
|
||||
|
||||
Blockly.Arduino.watchdog_reset = function () {
|
||||
var code = "Watchdog.reset();";
|
||||
return code;
|
||||
};
|
@ -14,6 +14,7 @@ const maxInstances = {
|
||||
sensebox_lora_initialize_otaa: 1,
|
||||
sensebox_lora_initialize_abp: 1,
|
||||
sensebox_phyphox_init: 1,
|
||||
sensebox_ethernet: 1,
|
||||
};
|
||||
|
||||
export const getMaxInstances = () => {
|
||||
|
@ -16,4 +16,14 @@ export const WEB = {
|
||||
senseBox_wifi_startap_tooltip:
|
||||
"Erstellt einen WiFi-Accesspoint zu dem du dich verbinden kannst. Beachte, dass immer nur 1 Gerät gleichzeitig verbunden werden kann.",
|
||||
senseBox_wifi_helpurl: "https://docs.sensebox.de/blockly/blockly-web-wifi/",
|
||||
senseBox_ethernet: "Verbinde mit Ethernet",
|
||||
senseBox_ethernet_dhcp: "DHCP",
|
||||
senseBox_ethernet_manuel_config: "Manuelle Konfiguration",
|
||||
senseBox_ethernet_ip: "IP-Adresse",
|
||||
senseBox_ethernet_gateway: "Gateway",
|
||||
senseBox_ethernet_subnetmask: "Subnetzmaske",
|
||||
senseBox_ethernet_mac: "MAC-Adresse",
|
||||
senseBox_ethernet_dns: "DNS-Server",
|
||||
senseBox_ethernet_tooltip:
|
||||
"Verbinde das LAN-Bee mit dem Steckplatz XBEE1. Die meisten Netzwerke verwenden DHCP und vergeben automatisch eine IP-Adresse. Solltest du eine Manuelle Konfiguration durchführen wollen wählen im Dropdown Menü **Manuelle Konfiguration** aus und gebe die entsprechenden Daten ein.",
|
||||
};
|
||||
|
@ -17,4 +17,14 @@ export const WEB = {
|
||||
"Creates a WiFi access point to which you can connect. Note that only 1 device can be connected at a time.",
|
||||
senseBox_wifi_helpurl:
|
||||
"https://en.docs.sensebox.de/blockly/blockly-web-wifi/",
|
||||
senseBox_ethernet: "Connect to Ethernet",
|
||||
senseBox_ethernet_dhcp: "DHCP",
|
||||
senseBox_ethernet_manuel_config: "Manual configuration",
|
||||
senseBox_ethernet_ip: "IP address",
|
||||
senseBox_ethernet_gateway: "Gateway",
|
||||
senseBox_ethernet_subnetmask: "Subnet mask",
|
||||
senseBox_ethernet_mac: "MAC address",
|
||||
senseBox_ethernet_dns: "DNS-Server",
|
||||
senseBox_ethernet_tooltip:
|
||||
"Connect the LAN-Bee to the XBEE1 slot. Most networks use DHCP and assign an IP address automatically. If you want to do a manual configuration select **Manual Configuration** in the dropdown menu and enter the appropriate data.",
|
||||
};
|
||||
|
@ -98,6 +98,10 @@ class Toolbox extends React.Component {
|
||||
<Block type="sensebox_get_ip" />
|
||||
<Block type="sensebox_startap" />
|
||||
</Category>
|
||||
<Category name="Ethernet" colour={getColour().sensebox}>
|
||||
<Block type="sensebox_ethernet" />
|
||||
<Block type="sensebox_ethernetIp" />
|
||||
</Category>
|
||||
<Category name="SD" colour={getColour().sensebox}>
|
||||
<Block type="sensebox_sd_create_file" />
|
||||
<Block type="sensebox_sd_open_file">
|
||||
@ -613,28 +617,34 @@ class Toolbox extends React.Component {
|
||||
custom="PROCEDURE"
|
||||
></Category>
|
||||
<sep></sep>
|
||||
<Category name={Blockly.Msg.toolbox_io} colour={getColour().io}>
|
||||
<Block type="io_digitalwrite"></Block>
|
||||
<Block type="io_digitalread"></Block>
|
||||
<Block type="io_builtin_led"></Block>
|
||||
<Block type="io_analogwrite"></Block>
|
||||
<Block type="io_analogread"></Block>
|
||||
<Block type="io_highlow"></Block>
|
||||
<Block type="io_pulsein">
|
||||
<Value name="PULSETYPE">
|
||||
<Shadow type="io_highlow"></Shadow>
|
||||
</Value>
|
||||
</Block>
|
||||
<Block type="io_pulsetimeout">
|
||||
<Value name="PULSETYPE">
|
||||
<Shadow type="io_highlow"></Shadow>
|
||||
</Value>
|
||||
<Value name="TIMEOUT">
|
||||
<Shadow type="math_number">
|
||||
<Field name="NUM">100</Field>
|
||||
</Shadow>
|
||||
</Value>
|
||||
</Block>
|
||||
<Category name="Advanced" colour={getColour().io}>
|
||||
<Category name={Blockly.Msg.toolbox_io} colour={getColour().io}>
|
||||
<Block type="io_digitalwrite"></Block>
|
||||
<Block type="io_digitalread"></Block>
|
||||
<Block type="io_builtin_led"></Block>
|
||||
<Block type="io_analogwrite"></Block>
|
||||
<Block type="io_analogread"></Block>
|
||||
<Block type="io_highlow"></Block>
|
||||
<Block type="io_pulsein">
|
||||
<Value name="PULSETYPE">
|
||||
<Shadow type="io_highlow"></Shadow>
|
||||
</Value>
|
||||
</Block>
|
||||
<Block type="io_pulsetimeout">
|
||||
<Value name="PULSETYPE">
|
||||
<Shadow type="io_highlow"></Shadow>
|
||||
</Value>
|
||||
<Value name="TIMEOUT">
|
||||
<Shadow type="math_number">
|
||||
<Field name="NUM">100</Field>
|
||||
</Shadow>
|
||||
</Value>
|
||||
</Block>
|
||||
</Category>
|
||||
<Category name="Watchdog" colour={getColour().io}>
|
||||
<Block type="watchdog_enable"></Block>
|
||||
<Block type="watchdog_reset"></Block>
|
||||
</Category>
|
||||
</Category>
|
||||
{/* this block is the initial block of the workspace; not necessary
|
||||
to display, because it can only be used once anyway
|
||||
|
Loading…
x
Reference in New Issue
Block a user