Fork of the rotary encoder library from the Teensy project: http://www.pjrc.com/teensy/td_libs_Encoder.html