You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Hi - thanks!

    I've just filed an issue for this here: https://github.com/espruino/Espruino/issues/2001

    It looks like Puck.js looks at BTN's state after any reset, not just when it boots. I'll have a look at fixing that for the next release.

    However, to work around it an easy fix is just to trigger your command when the button is released, not when it's pressed (eg rising -> falling):

    setWatch(function() {
      LED1.write(1); reset();
    }, BTN, {edge:"falling", debounce:50, repeat:true}); 
    
About

Avatar for Gordon @Gordon started