WIRING of KY-040 Rotary Encoder plus Demo Code

I am very new to this arduino, but am learning. I want to control a small stepper motor remotely wired to turn an air capacitor for a magnetic loop antenna. I figured using a rotary encoder to turn the motor at the same speed and movement as the encoder. does anyone have any insight to this and can point me in the right direction, thank you