Converted Red interactions to all hardwarePWM.
This commit is contained in:
parent
13f16e0b18
commit
4c11d57a6c
1 changed files with 2 additions and 1 deletions
|
@ -8,6 +8,7 @@ const DEBUG = !!process.env["DEBUG"];
|
|||
|
||||
//Let's setup our connections to our physical hardware devices.
|
||||
let ledRed = new Gpio(12, {mode: Gpio.OUTPUT});
|
||||
ledRed.hardwarePwmWrite(HZ, 0);
|
||||
let ledGreen = new Gpio(13, {mode: Gpio.OUTPUT});
|
||||
let napButton = new Gpio(6, {mode: Gpio.INPUT, pullUpDown: Gpio.PUD_UP, alert: true });
|
||||
napButton.glitchFilter(10000);
|
||||
|
@ -99,7 +100,7 @@ function render() {
|
|||
case "green":
|
||||
if(ledRed.getPwmDutyCycle()) {
|
||||
DEBUG && console.log("Turning off Red LED.");
|
||||
return ledRed.digitalWrite(0);
|
||||
return ledRed.hardwarePwmWrite(0);
|
||||
}
|
||||
if(!ledGreen.digitalRead()) {
|
||||
DEBUG && console.log("Turning on Green LED.");
|
||||
|
|
Loading…
Reference in a new issue