I notice @benoit that enterBatteryCheckState() is called during "run" when any of the switchxRising/Falling() code is executed. What is the load that is seen by analogRead() and by the display update? Does the current drop after the five second timeout?
Try commenting your some of the nested setTimout() sections as there is a lot going on there.
Divide and conquer as @Gordon suggested. This is going to be fun! Keep us posted on what is discovered.
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 notice @benoit that
enterBatteryCheckState()
is called during "run" when any of theswitchxRising/Falling()
code is executed. What is the load that is seen byanalogRead()
and by the display update? Does the current drop after the five second timeout?Try commenting your some of the nested
setTimout()
sections as there is a lot going on there.Divide and conquer as @Gordon suggested. This is going to be fun! Keep us posted on what is discovered.