To be clear: Puck.magOff is not called anywhere in between.
This happened with Puck.getBatteryPercentage() at 38. After replacing the battery with a new one, it all works fine again.
I suppose this should be added to documentation, or handled on a lower level - e.g. throw an error from Puck.magOn when battery voltage is below some level...
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 noticed the following behaviour:
Puck.on("mag", lsnr)
Puck.magOn(5)
lsnr
is called only about 5 times and no moreTo be clear:
Puck.magOff
is not called anywhere in between.This happened with
Puck.getBatteryPercentage()
at 38. After replacing the battery with a new one, it all works fine again.I suppose this should be added to documentation, or handled on a lower level - e.g. throw an error from
Puck.magOn
when battery voltage is below some level...