You are reading a single comment by @BogdanG and its replies. Click here to read the full conversation.
  • I tested simple de-bouncer. The setWatch is used once, then re-enabled after a period of 200ms just after the associated function is called:

    function test(){
    	console.log("Hello!");		//the actual task done after pressing the BTN1
    	setTimeout(setupBTN1, 200);	//every time test() is ran the BTN1 handler is enabled again after a period of 200ms
    }
    
    function setupBTN1(){
    	setWatch(test, BTN1, {repeat:false, edge:"rising"});
    }
    
    setupBTN1();	//single BTN1-triggered test() function call is enabled 
    
About

Avatar for BogdanG @BogdanG started