The code works fine when connected to USB (my understanding is that deep sleep is disabled in that case anyway). It does not work when connected to a battery. Instead of blinking for 5 seconds every 10 seconds, it blinks every 10 seconds for like 3 ms (measured by monitoring the current consumption with an oscilloscope).
If I remove the setDeepSleep, then it works fine even with a battery - albeit with a lot higher power consumption, of course. I monitor the battery voltage and stays constant at about 4 V (Li-Ion).
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.
Hi,
I have a problem with the setDeepSleep. My understanding is that it should work on the Espruino Pico. Is this correct?
It does lead to weird effects for me. Basically I am using the following snippet from the power tutorial (with different constants):
The code works fine when connected to USB (my understanding is that deep sleep is disabled in that case anyway). It does not work when connected to a battery. Instead of blinking for 5 seconds every 10 seconds, it blinks every 10 seconds for like 3 ms (measured by monitoring the current consumption with an oscilloscope).
If I remove the setDeepSleep, then it works fine even with a battery - albeit with a lot higher power consumption, of course. I monitor the battery voltage and stays constant at about 4 V (Li-Ion).
Am I doing something wrong?
Thanks!