

When the timer finishes counting down, the LED automatically turns off. Will have to check for polling the debounce. As an example, we’ll detect motion using a PIR motion sensor: when motion is detected, the ESP8266 starts a timer and turns an LED on for a predefined number of seconds. When the debounce reg=0xff, (other than zero), the pin should used as normal pin. When the debounce reg = 0x00, the pin should work for External interrupt trigger. When the debounce process is over, can i Enable the External interrupt? Disable the External interrupt inside the ISR routine. If the debounce reg=0×ff, (other than Zero), when the external interrupt triggers, i will start the debouncing process in the timer interrupt.


If the debounce reg=0×00, when the external interrupt triggers, it will switch ON the output pin within 3 clock cycle. I have to disable External interrupt inside the ISR when it start/trigger the debounce process? Otherwise it will goes to external interrupt routine continuously? You would look at the table and see the minimum overflow value that is larger than 195.7ms. Lets say you want a repeat rate of exactly 195.7ms. I understood that we can not do the debouncing process inside the ISR. Arduino Timer Interrupt: Set the desired repeat rate. If the External interrupt triggers, it will go to the ISR routine. Well, you could use an interrupt to start/trigger the debounce process - but, indeed, you wouldn't do the actual debouncing within the ISR
