Concept Flow - Interrupt-driven button handling
Setup Interrupt
Wait for Button Press
Interrupt Triggered?
No→Wait
Yes
Run ISR (Interrupt Service Routine)
Handle Button Press
Return to Main Loop
The program sets up an interrupt for the button pin, waits for a press, then runs a special function (ISR) immediately when pressed, handling the event quickly before returning to normal.