• The code "works" ie it give me some nice LED's
    The problem is, it stops working after a time.

    // our main function
    function puckLeds(){
      let leds= 0;
      let timerId = null;
    
      digitalWrite([LED3,LED2,LED1], leds);
    
      // watch for the Big Red Button
      setWatch(function() {
        if ( timerId !== null){
          clearTimeout(timerId);
        } 
        leds = (leds + 1)%7;
        digitalWrite([LED3,LED2,LED1], leds);
        timerId = setTimeout(function () {
        digitalWrite([LED3,LED2,LED1], 0);
        }, 10000);
      }, BTN, {edge:"falling", debounce:100, repeat:true}); 
    }
    
    // ensure that the code is available after reload or whatever
    E.on('init', function() {
      console.log("hello");
      puckLeds();
    });
    
    save();
    

    Edit after input below.
    Placement of pulldown did not seem to work
    pinMode(BTN,"input_pulldown");

    function puckLeds(){
      let leds= 0;
      let timerId = null;
    
      digitalWrite([LED3,LED2,LED1], leds);
    
      setWatch(function() {
        // pinMode(BTN,"input_pulldown");
        if ( timerId !== null){
          clearTimeout(timerId);
        } 
        leds = (leds + 1)%7;
        digitalWrite([LED3,LED2,LED1], leds);
        timerId = setTimeout(function () {
        digitalWrite([LED3,LED2,LED1], 0);
        }, 10000);
      }, BTN, {edge:"falling", debounce:100, repeat:true}); 
      pinMode(BTN,"input_pulldown");
    }
    
    E.on('init', function() {
      console.log("hello");
      puckLeds();
    });
    
    save();
    
About