Rotary encoder class library for Mega (can be customized for others)