The default debounce setting (10ms) per setWatch() docs doesn't seem to do anything. When I add debounce: 20 (or any value), it prevents the callback from getting any args. Code below.
Recommendations?
var button=B5;
pinMode(button, 'input_pulldown');
function buttonPressed(info) {
console.log(info); // [ undefined ]
info.time; // Uncaught Error: Field or method "time" does not already exist, and can't create it on undefined
}
setWatch(buttonPressed,button,
{repeat:true,debounce:200});
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Firmware 1v79
I have a noisy button on B5.
The default debounce setting (10ms) per setWatch() docs doesn't seem to do anything. When I add debounce: 20 (or any value), it prevents the callback from getting any args. Code below.
Recommendations?