0PricingLogin
Arduino & IoT Academy · Lesson

Writing a Safe ISR

Keep interrupt handlers short and use volatile.

A Special Function

An ISR, or interrupt service routine, is the function that runs when an interrupt fires. It has rules that ordinary functions do not.

Keep It Short

The golden rule: make your ISR as short as possible. The main program is paused while it runs, so finish fast and get out.

All lessons in this course

  1. Polling vs Interrupts
  2. attachInterrupt on a Pin
  3. Writing a Safe ISR
  4. Count Pulses from an Encoder
← Back to Arduino & IoT Academy