From e8c328a9e1e75240317b2300ff12caf47329a5b3 Mon Sep 17 00:00:00 2001 From: Dave C-J Date: Mon, 31 Mar 2014 22:37:28 +0100 Subject: [PATCH] Tweaks to verify input to Pirella Node, remove unused variable. --- hardware/Pi/38-rpi-pibrella.html | 11 +++++------ hardware/Pi/38-rpi-pibrella.js | 9 ++++----- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/hardware/Pi/38-rpi-pibrella.html b/hardware/Pi/38-rpi-pibrella.html index 73a3802d..3a24e97e 100644 --- a/hardware/Pi/38-rpi-pibrella.html +++ b/hardware/Pi/38-rpi-pibrella.html @@ -18,7 +18,7 @@
- + @@ -73,7 +72,7 @@ - +
@@ -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, diff --git a/hardware/Pi/38-rpi-pibrella.js b/hardware/Pi/38-rpi-pibrella.js index 140b2286..48e8b23d 100644 --- a/hardware/Pi/38-rpi-pibrella.js +++ b/hardware/Pi/38-rpi-pibrella.js @@ -33,7 +33,7 @@ if (!fs.existsSync("/usr/local/bin/gpio")) { var pintable = { // Physical : WiringPi "Amber LED":"0", - "Buzzer":"1", + "Buzzer ":"1", "Red LED":"2", "Out E":"3", "Out F":"4", @@ -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); } }); }