From f2cc2bb321e544b14676e7bf318f0476f51fff5c Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Tue, 18 Apr 2017 16:39:56 +0100 Subject: [PATCH] correct maths and help for servo min/max timings --- hardware/pigpiod/locales/en-US/pi-gpiod.json | 2 +- hardware/pigpiod/package.json | 4 ++-- hardware/pigpiod/pi-gpiod.html | 8 ++++---- hardware/pigpiod/pi-gpiod.js | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hardware/pigpiod/locales/en-US/pi-gpiod.json b/hardware/pigpiod/locales/en-US/pi-gpiod.json index ef20b888..69199beb 100644 --- a/hardware/pigpiod/locales/en-US/pi-gpiod.json +++ b/hardware/pigpiod/locales/en-US/pi-gpiod.json @@ -33,7 +33,7 @@ "in": "Tip: Only Digital Input is supported - input must be 0 or 1.", "dig": "Tip: For digital output - input must be 0 or 1.", "pwm": "Tip: For PWM output - input must be between 0 to 100.", - "ser": "Tip: For Servo output - input must be between 0 to 100. 50 is centre.
Min must be 5mS or more, Max must be 25mS or less." + "ser": "Tip: For Servo output - input must be between 0 to 100. 50 is centre.
Min must be 500uS or more, Max must be 2500uS or less." }, "types": { "digout": "digital output", diff --git a/hardware/pigpiod/package.json b/hardware/pigpiod/package.json index e19556b3..975bf29d 100644 --- a/hardware/pigpiod/package.json +++ b/hardware/pigpiod/package.json @@ -1,9 +1,9 @@ { "name": "node-red-node-pi-gpiod", - "version": "0.0.2", + "version": "0.0.3", "description": "A node-red node for PiGPIOd", "dependencies" : { - "js-pigpio": "^1.0.0" + "js-pigpio": "*" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" diff --git a/hardware/pigpiod/pi-gpiod.html b/hardware/pigpiod/pi-gpiod.html index a2918300..1e16d9b2 100644 --- a/hardware/pigpiod/pi-gpiod.html +++ b/hardware/pigpiod/pi-gpiod.html @@ -161,9 +161,9 @@
- mS + uS       - mS + uS
@@ -226,8 +226,8 @@ set: { value:"" }, level: { value:"0" }, out: { value:"out" }, - sermin: { value:"10" }, - sermax: { value:"20" } + sermin: { value:"1000" }, + sermax: { value:"2000" } }, inputs:1, outputs:0, diff --git a/hardware/pigpiod/pi-gpiod.js b/hardware/pigpiod/pi-gpiod.js index 1e747a4e..10927246 100644 --- a/hardware/pigpiod/pi-gpiod.js +++ b/hardware/pigpiod/pi-gpiod.js @@ -86,8 +86,8 @@ module.exports = function(RED) { this.set = n.set || false; this.level = parseInt(n.level || 0); this.out = n.out || "out"; - this.sermin = Number(n.sermin); - this.sermax = Number(n.sermax); + this.sermin = Number(n.sermin)/100; + this.sermax = Number(n.sermax)/100; if (this.sermin > this.sermax) { var tmp = this.sermin; this.sermin = this.sermax;