SRF node - add ability to set time interval

to close #338
This commit is contained in:
Dave Conway-Jones
2017-08-14 09:20:18 +01:00
parent 7950b7d39a
commit 363bb55b26
5 changed files with 19 additions and 10 deletions

View File

@@ -26,12 +26,13 @@ module.exports = function(RED) {
RED.nodes.createNode(this, n);
this.topic = n.topic;
this.pins = n.pins;
this.pins += ","+(n.pulse || 0.5);
var node = this;
if (node.pins !== undefined) {
node.child = spawn(gpioCommand, [node.pins]);
node.running = true;
if (RED.settings.verbose) { node.log("pin: " + node.pins + " :"); }
if (RED.settings.verbose) { node.log("parameters: " + node.pins + " :"); }
node.child.stdout.on('data', function(data) {
if (RED.settings.verbose) { node.log("out: " + data + " :"); }
@@ -59,7 +60,7 @@ module.exports = function(RED) {
}
else {
node.error("Invalid GPIO pins: " + node.pin);
node.error("Invalid Parameters: " + node.pins);
}
var wfi = function(done) {