A rotary encoder is used to finely control an output, such as the rotation of a motor, the cursor position on a screen or simply the brightness of an LED. Rotary encoders are used as control switches, such as on audio equipment. The rotary encoder has 20 positions, but the rotor can be continuously rotated either forward or backward to increase or decrease a control variable.
There are three pins inside a rotary encoder: a common pin and two pins, termed A and B, which are offset. As the rotor turns, pins A and ...