Compare commits
4 Commits
master
...
add-rainse
Author | SHA1 | Date | |
---|---|---|---|
|
0388e5c627 | ||
|
9c33bc4c0d | ||
|
32372bc222 | ||
|
dbc7fdc7ab |
@ -514,6 +514,40 @@ Blockly.Blocks["sensebox_soundsensor_dfrobot"] = {
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* rainsensor hydreon rg-15
|
||||
*/
|
||||
|
||||
Blockly.Blocks["sensebox_rainsensor_hydreon_rg15"] = {
|
||||
init: function () {
|
||||
var dropdownOptionsPorts = [
|
||||
[Blockly.Msg.sensebox_rainsensor_hydreon_rg15_serial1, "Serial1"],
|
||||
[Blockly.Msg.sensebox_rainsensor_hydreon_rg15_serial2, "Serial2"],
|
||||
];
|
||||
var dropdownOptionsValues = [
|
||||
[Blockly.Msg.sensebox_rainsensor_hydreon_rg15_acc, "getAccumulation"],
|
||||
[Blockly.Msg.sensebox_rainsensor_hydreon_rg15_totalAcc, "getTotalAccumulation"],
|
||||
[Blockly.Msg.sensebox_rainsensor_hydreon_rg15_eventAcc, "getEventAccumulation"],
|
||||
[Blockly.Msg.sensebox_rainsensor_hydreon_rg15_rainInt, "getRainfallIntensity"],
|
||||
];
|
||||
this.setColour(getColour().sensebox);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.sensebox_rainsensor_hydreon_rg15);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.sensebox_rainsensor_hydreon_rg15_port)
|
||||
.appendField(new Blockly.FieldDropdown(dropdownOptionsPorts), "SERIAL");
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.sensebox_rainsensor_hydreon_rg15_value)
|
||||
.appendField(new Blockly.FieldDropdown(dropdownOptionsValues), "VALUE");
|
||||
this.setOutput(true, Types.DECIMAL.typeName);
|
||||
this.setTooltip(Blockly.Msg.sensebox_rainsensor_hydreon_rg15_tooltip);
|
||||
this.setHelpUrl(Blockly.Msg.sensebox_rainsensor_hydreon_rg15_helpurl);
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Infineon DPS310 Pressure Sensor
|
||||
*
|
||||
|
@ -654,6 +654,23 @@ float getSoundValue(){
|
||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
||||
};
|
||||
|
||||
/**
|
||||
* rainsensor hydreon rg-15
|
||||
*/
|
||||
|
||||
Blockly.Arduino.sensebox_rainsensor_hydreon_rg15 = function () {
|
||||
var port = this.getFieldValue("SERIAL");
|
||||
var value = this.getFieldValue("VALUE");
|
||||
Blockly.Arduino.libraries_["library_senseBoxIO"] = "#include <senseBoxIO.h>";
|
||||
Blockly.Arduino.libraries_["library_rainsensor_rg15"] = "#include <hydreon.h>";
|
||||
Blockly.Arduino.definitions_["def_rainsensor_rg15_" + port] = "HYDREON rainsensor_" + port + "(" + port + ");";
|
||||
Blockly.Arduino.setupCode_["setup_rainsensor_rg15_" + port] = "rainsensor_" + port + ".begin();";
|
||||
Blockly.Arduino.loopCodeOnce_["loop_rainsensor_rg15_" + port] = "rainsensor_" + port + ".readAllData();"
|
||||
|
||||
var code = "rainsensor_" + port + "." + value + "()";
|
||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
||||
};
|
||||
|
||||
/**
|
||||
* Infineon DPS310 Pressure Sensor
|
||||
*
|
||||
|
@ -132,10 +132,25 @@ Wenn die maximale Distanz überschritten wird, wird ein Wert von **O** ausgegebe
|
||||
"Schließe den Sensor an einen der 3 **digital/analog Ports** an. Der Sensor gibt dir den Messwert in dB mit einer Nachkommastelle",
|
||||
senseBox_soundsensor_dfrobot_helpurl:
|
||||
"https://docs.sensebox.de/hardware/sensoren-lautstaerke/",
|
||||
/*
|
||||
* BME680
|
||||
*/
|
||||
|
||||
/*
|
||||
* rainsensor hydreon rg-15
|
||||
*/
|
||||
sensebox_rainsensor_hydreon_rg15: "Regensensor (RG-15)",
|
||||
sensebox_rainsensor_hydreon_rg15_port: "Serieller Port:",
|
||||
sensebox_rainsensor_hydreon_rg15_serial1: "Serial1",
|
||||
sensebox_rainsensor_hydreon_rg15_serial2: "Serial2",
|
||||
sensebox_rainsensor_hydreon_rg15_value: "Messwert:",
|
||||
sensebox_rainsensor_hydreon_rg15_totalAcc: "gesamter Niederschlag in mm",
|
||||
sensebox_rainsensor_hydreon_rg15_rainInt: "Niederschlagsintensität in mm/h",
|
||||
sensebox_rainsensor_hydreon_rg15_eventAcc: "Niederschlag pro Event in mm",
|
||||
sensebox_rainsensor_hydreon_rg15_acc: "Niederschlag seit letzter Messung in mm",
|
||||
sensebox_rainsensor_hydreon_rg15_tooltip: "Regensensor (RG-15) an einen der Seriellen Ports anschließen.",
|
||||
sensebox_rainsensor_hydreon_rg15_helpurl: "https://rainsensors.com/products/rg-15/",
|
||||
|
||||
/*
|
||||
* BME680
|
||||
*/
|
||||
senseBox_bme680: "Umweltsensor (BME680)",
|
||||
senseBox_bme_iaq: "Innenraumluftqualität (IAQ)",
|
||||
senseBox_bme_iaq_accuracy: "Kalibrierungswert",
|
||||
|
@ -134,6 +134,21 @@ If the max distance is reached the a value of **O** will be returned`,
|
||||
senseBox_soundsensor_dfrobot_helpurl:
|
||||
"https://en.docs.sensebox.de/hardware/sensoren-lautstaerke/",
|
||||
|
||||
/*
|
||||
* rainsensor hydreon rg-15
|
||||
*/
|
||||
sensebox_rainsensor_hydreon_rg15: "Rainsensor (RG-15)",
|
||||
sensebox_rainsensor_hydreon_rg15_port: "Serial Port:",
|
||||
sensebox_rainsensor_hydreon_rg15_serial1: "Serial1",
|
||||
sensebox_rainsensor_hydreon_rg15_serial2: "Serial2",
|
||||
sensebox_rainsensor_hydreon_rg15_value: "value:",
|
||||
sensebox_rainsensor_hydreon_rg15_totalAcc: "total Accumulation in mm",
|
||||
sensebox_rainsensor_hydreon_rg15_rainInt: "Rainfall Intensity in mm/h",
|
||||
sensebox_rainsensor_hydreon_rg15_eventAcc: "Accumulation per Event in mm",
|
||||
sensebox_rainsensor_hydreon_rg15_acc: "Accumulation since last loop in mm",
|
||||
sensebox_rainsensor_hydreon_rg15_tooltip: "Connect Rainsensor (RG-15) to one of the Serial ports.",
|
||||
sensebox_rainsensor_hydreon_rg15_helpurl: "https://rainsensors.com/products/rg-15/",
|
||||
|
||||
/*
|
||||
* BME680
|
||||
*/
|
||||
|
@ -76,6 +76,7 @@ class Toolbox extends React.Component {
|
||||
<Block type="sensebox_sensor_watertemperature" />
|
||||
{/* <Block type="sensebox_windspeed" /> */}
|
||||
<Block type="sensebox_soundsensor_dfrobot" />
|
||||
<Block type="sensebox_rainsensor_hydreon_rg15" />
|
||||
<Block type="sensebox_multiplexer_init">
|
||||
<Value name="nrChannels">
|
||||
<Block type="math_number">
|
||||
|
Loading…
x
Reference in New Issue
Block a user