That should reboot if you hold button for >5 seconds. Which actually may not be best idea if this can happen normally but one can perhaps combine it also when being on charger (D2.read()).
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.
Because it takes 1 as 1 second? Try higher values. Anyway the manual mode may be safer. What about something like this
That should reboot if you hold button for >5 seconds. Which actually may not be best idea if this can happen normally but one can perhaps combine it also when being on charger (
D2.read()
).