In system programming, an interrupt is a signal to the processor emitted by hardware or software indicating an event that needs immediate attention. An interrupt alerts the processor to a high-priority condition requiring the interruption of the current code the processor is executing. The processor responds by suspending its current activities, saving its state, and executing a function called an interrupt handler (or an interrupt service routine, ISR) to deal with the event. This interruption is temporary, and, after the interrupt handler finishes, the processor resumes normal activities.
In this tutorial we learn how to use external interrupts with ESP8266? External interrupts configuration requires three step process.
- Initialize IO pin as Input.
- Initialize IO with Interrupt Subroutine definition.
- Interrupt Subroutine.
The ESP8266 has two different kinds of interrupts: “external”, and “pin change”. ESP8266 all pins have external interrupt except GPIO 16. These interrupts can be set to trigger on RISING or FALLING signal edges, or CHANGE of level.