Open michaeljanich opened 6 years ago
I use wpi.wiringPiISR(this.switchpin, wpi.INT_EDGE_RISING, this.toggle.bind(this)); to connect to a switch button and toggle a light.
wpi.wiringPiISR(this.switchpin, wpi.INT_EDGE_RISING, this.toggle.bind(this));
But I get bounce. Usually I [Arduino] software-debounce with
if (digitalRead(pin)) { delay(25); if (digitalRead(pin)) { toggle(); } }
How is that best done on node? with wpi.delay(25)? or setTimeout(function() {}, 25);?
wpi.delay(25)
setTimeout(function() {}, 25);
THANKS
I use
wpi.wiringPiISR(this.switchpin, wpi.INT_EDGE_RISING, this.toggle.bind(this));
to connect to a switch button and toggle a light.But I get bounce. Usually I [Arduino] software-debounce with
How is that best done on node? with
wpi.delay(25)
? orsetTimeout(function() {}, 25);
?THANKS