Hi,
just a rider,
I've been looking at the ALPS encoders and it would appear that they have a design feature that departs from the classic quadrature encoder.
The contacts require a 10K pull-up to Vdd and go low when the shaft is rotated. Rather than maintain the low state, both outputs go open when the shaft is in the detent position. This reduces the power consumption by 500uA (0.5mA) when the encoder is idle, significant power in battery operated designs. This also gives the two pulse per click characteristic. There was nothing wrong with your code.
Robert G8RPI.
Bookmarks