Class to decode a mechanical rotary encoder.