The rotary encoder is a rotary input device (like a knob) that provides indication of how much the knob has been turned and in which direction it is rotating.
It is an excellent device for controlling stepper motors and servo motors. It can also be used to control devices such as digital potentiometers.