I created a LED dimming function (source code). It does what I expect it to do every DURATION miliseconds, with an exception. I added two console logs to highlight the problem, this is the line which does not work, clearInterval(stepInterval), logging ERROR: Unknown Interval.
All the other clearIntervals seem to be working. Here is some sample output from the script:
run to 1
clearing stepInterval number 11
ERROR: Unknown Interval
should have cleared stepInterval number 11
done 1.
done 0.99
run to 0
clearing stepInterval number 13
ERROR: Unknown Interval
should have cleared stepInterval number 13
done -0.
done 0.01
run to 1
clearing stepInterval number 15
ERROR: Unknown Interval
should have cleared stepInterval number 15
done 1.
done 0.99
run to 0
clearing stepInterval number 17
ERROR: Unknown Interval
should have cleared stepInterval number 17
done -0.
done 0.01
run to 1
clearing stepInterval number 19
ERROR: Unknown Interval
should have cleared stepInterval number 19
So the intervals keep adding up, I assume it will either run out of memory or gray dragons will come out of the espruino board.
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.
I created a LED dimming function (source code). It does what I expect it to do every
DURATION
miliseconds, with an exception. I added two console logs to highlight the problem, this is the line which does not work,clearInterval(stepInterval)
, loggingERROR: Unknown Interval
.All the other
clearInterval
s seem to be working. Here is some sample output from the script:So the intervals keep adding up, I assume it will either run out of memory or gray dragons will come out of the espruino board.
Any hints?