attachInterrupt on a Pin
Run code the instant a signal changes.
Wiring Code to a Pin
The attachInterrupt function tells your board: watch this pin, and the moment its signal changes, run my function right away.
Only Special Pins
Not every pin supports interrupts. On an Uno only pins 2 and 3 do, so plug your signal into one of those.
All lessons in this course
- Polling vs Interrupts
- attachInterrupt on a Pin
- Writing a Safe ISR
- Count Pulses from an Encoder