Arduino Rotary Encoder Kullanımı. In this post we will focus on a rotary encoder with a shaft attached to it in the form of a knob. The output of an absolute encoder indicates the current shaft position making it an angle transducer.

Define the switch pin at 5. We will be focusing on digital devices today. Like other mechanical switches rotary encoders are prone to switch bouncing.
The shaft itself can be part of the sensor or the sensor can have a hole for a shaft to go through ideal when you want to attach the sensor to a piece of rotating equipment.
When shaft is not turning and are at different states when between detents. If you have a reading of 01 the next reading can either be 00 or 11 depending on the direction the knob is turned. Rotary encoders with centre push buttons are cool input hardware for projects especially if you want to be able to scroll through menus and select options. If you treat the pins as binary you can read them as 00 01 10 or 11 sequence the encoder outputs while spinning clockwise is 00 01 11 10.