Rotary encoders can be used similarly to potentiometers. The difference being that an encoder has full rotation without limits (It just goes round and round). This is a quadrature encoder and outputs similar to 2-bit gray code so that you can tell how much and in which direction the encoder has been turned. They’re great for navigating menu screens and things like that.
This encoder is especially cool because it has a common anode RGB LED built in, as well as a push-button.
Image and content credit : Sparkfun