added rainsensor
This commit is contained in:
parent
426b87e84d
commit
dbc7fdc7ab
@ -514,6 +514,39 @@ 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_totalAcc, "getTotalAccumulation"],
|
||||
[Blockly.Msg.sensebox_rainsensor_hydreon_rg15_rainInt, "getRainfallIntensity"],
|
||||
[Blockly.Msg.sensebox_rainsensor_hydreon_rg15_eventAcc, "getEventAccumulation"],
|
||||
[Blockly.Msg.sensebox_rainsensor_hydreon_rg15_acc, "getAccumulation"],
|
||||
];
|
||||
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"] = "HYDREON rainsensor_" + port + "(" + port + ");";
|
||||
Blockly.Arduino.setupCode_["setup_rainsensor_rg15"] = "rainsensor_" + port + ".begin();";
|
||||
Blockly.Arduino.loopCodeOnce_["loop_rainsensor_rg15"] = "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: "TODO",
|
||||
|
||||
/*
|
||||
* BME680
|
||||
*/
|
||||
senseBox_bme680: "Umweltsensor (BME680)",
|
||||
senseBox_bme_iaq: "Innenraumluftqualität (IAQ)",
|
||||
senseBox_bme_iaq_accuracy: "Kalibrierungswert",
|
||||
|
@ -76,6 +76,8 @@ 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_init" />
|
||||
<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