• @DrAzzy ,what is the proper code form to stop interval that way you said?
    I tried

    clearInterval(){1}
    

    and it works when I typed it into console,
    but when I placed that form into my code into if statement
    WebIDE shows errors,
    I used then clearInterval(1); instead but it isn't work

  • DrAzzy means when you set your interval you assign it to a global variable. For example

    var state, interval;
    function toggleLed(){
      digitalWrite(LED1,state=!state);
    }
    
    setWatch(function() {interval=setInterval(toggleLed,500);},BTN, {repeat: true, edge: 'rising', debounce:5});
    

    You would call clearInterval(interval) to stop only this interval.

About

Avatar for bigplik @bigplik started