From 2046211fc1923a57f9fba092dbf09cdace511198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=A4fele?= Date: Fri, 30 Mar 2018 18:31:53 +0200 Subject: [PATCH] Forgot to adapt logical code to not use checkbox value --- hardware/pigpiod/pi-gpiod.html | 1 - hardware/pigpiod/pi-gpiod.js | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/hardware/pigpiod/pi-gpiod.html b/hardware/pigpiod/pi-gpiod.html index de458b00..c480e25c 100644 --- a/hardware/pigpiod/pi-gpiod.html +++ b/hardware/pigpiod/pi-gpiod.html @@ -452,7 +452,6 @@ set: { value:"" }, level: { value:"0" }, out: { value:"out" }, - setfreq: { value:""}, freq: { value:"800" }, sermin: { value:"1000" }, sermax: { value:"2000" } diff --git a/hardware/pigpiod/pi-gpiod.js b/hardware/pigpiod/pi-gpiod.js index 16dbd635..93e95bda 100644 --- a/hardware/pigpiod/pi-gpiod.js +++ b/hardware/pigpiod/pi-gpiod.js @@ -86,7 +86,6 @@ module.exports = function(RED) { this.set = n.set || false; this.level = parseInt(n.level || 0); this.out = n.out || "out"; - this.setfreq = n.setfreq || false; this.freq = Number(n.freq || 800); if (this.freq < 5) { this.freq = 5; } if (this.freq > 40000) { this.freq = 40000; } @@ -150,10 +149,10 @@ module.exports = function(RED) { } else { node.status({fill:"green",shape:"dot",text:"node-red:common.status.ok"}); } - if (node.setfreq) { + if (node.out === "pwm") { PiGPIO.set_PWM_frequency(node.pin,node.freq); + //PiGPIO.set_PWM_range(node.pin,1000); } - //PiGPIO.set_PWM_range(node.pin,1000); } }); }