mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Tweaks to verify input to Pirella Node, remove unused variable.
This commit is contained in:
parent
ab8d6b1b65
commit
e8c328a9e1
@ -45,8 +45,7 @@
|
||||
color:"#c6dbef",
|
||||
defaults: {
|
||||
name: { value:"" },
|
||||
intype: { value: "in" },
|
||||
pin: { value:"",required:true },
|
||||
pin: { value:"",required:true,validate:RED.validators.regex(/ /) }
|
||||
},
|
||||
inputs:0,
|
||||
outputs:1,
|
||||
@ -96,7 +95,7 @@
|
||||
color:"#c6dbef",
|
||||
defaults: {
|
||||
name: { value:"" },
|
||||
pin: { value:"",required:true },
|
||||
pin: { value:"",required:true,validate:RED.validators.regex(/ /) }
|
||||
},
|
||||
inputs:1,
|
||||
outputs:0,
|
||||
|
@ -49,7 +49,7 @@ var pintable = {
|
||||
var tablepin = {
|
||||
// WiringPi : Physical
|
||||
"0":"Amber",
|
||||
"Buzzer":"1",
|
||||
"1":"Buzzer",
|
||||
"2":"Red",
|
||||
"3":"E",
|
||||
"4":"F",
|
||||
@ -67,11 +67,10 @@ function PibrellaIn(n) {
|
||||
RED.nodes.createNode(this,n);
|
||||
this.buttonState = -1;
|
||||
this.pin = pintable[n.pin];
|
||||
this.intype = n.intype;
|
||||
var node = this;
|
||||
|
||||
if (this.pin) {
|
||||
exec("gpio mode "+node.pin+" "+node.intype, function(err,stdout,stderr) {
|
||||
exec("gpio mode "+node.pin+" in", function(err,stdout,stderr) {
|
||||
if (err) node.error(err);
|
||||
else {
|
||||
node._interval = setInterval( function() {
|
||||
@ -88,7 +87,7 @@ function PibrellaIn(n) {
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 250);
|
||||
}, 200);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user