Add encoder feature (based on arduino external interrupts)