Interfacing a quadrature encoder with an ATmega or ATtiny. Quadrature encoders may be incremental or absolute. Those used in this article are incremental