0Pricing
Arduino & IoT Academy · Lesson

Count Pulses from an Encoder

Tally fast edges without missing any.

A Wheel of Pulses

A rotary encoder sends a quick stream of electrical pulses as it spins. Count those pulses and you know how far it has turned.

Too Fast to Poll

Spin an encoder quickly and pulses fly by in microseconds. A normal loop reading the pin would miss many of them.

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