With this:
setWatch(function (a) { digitalWrite(LED2, a.state); }, BTN, {repeat:true, debounce:0, edge:'both'});
Press the BTN a few times and the green led remains on sometimes, so the last edge has been missed?
@Georg started
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.
With this:
Press the BTN a few times and the green led remains on sometimes, so the last edge has been missed?