Rotary encoder with Arduino

Arduino code example

This is the code example that should also be featured in the library examples.

Wiring of the encoder for the featured example

The default wiring has signals A and B wired to analog inputs A0 and A1 respectively. The push-button goes to A2.

ALPS EC11 series with pushbutton.

I think it is also important to use pull-up resistors on the inputs, however they are not shown here on this example.

Note, that the incoming pulses are LOW, not HIGH, as one might expect. This was the source of my first frustration with this library, when I thought, that incoming pulses should be HIGH.

Default wiring. Push-button is shown separately.

Share this Page