Atmel AVR C++ RotaryEncoder Implementation