One more question because this is driving me nuts and I can't find the reason why ledTimer gets incremented at all.
What happens when I clearTimeout(ledTimer) ? Is it set to an empty function so that when it comes to the given time it does nothing, or is it really removed?
Also when I add console.log(process.memory()); at the beginning of watch function then it shows memory usage goes up quite a lot when I press the button before the timeout passed.
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.
One more question because this is driving me nuts and I can't find the reason why
ledTimer
gets incremented at all.What happens when I
clearTimeout(ledTimer)
? Is it set to an empty function so that when it comes to the given time it does nothing, or is it really removed?Also when I add
console.log(process.memory());
at the beginning of watch function then it shows memory usage goes up quite a lot when I press the button before the timeout passed.The output now looks like that: