© Neil Cameron 2019
Neil CameronArduino Appliedhttps://doi.org/10.1007/978-1-4842-3960-5_9

9. Rotary Encoder

Neil Cameron1 
Edinburgh, UK

../images/471900_1_En_9_Chapter/471900_1_En_9_Figa_HTML.jpgA 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 ...

Get Arduino Applied: Comprehensive Projects for Everyday Electronics now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.