Wire the RED wire to the +5V pin (normally red) of a digital input.
Wire the BLACK wire to the GND pin (normally black) of a digital input.
Wire the BLUE wire to the SIG pin (normally white) of a digital input.
Wire the YELLOW wire to another SIG pin (normally white) of a second digital input.
This means that you will need all 3 pins of one digital input, and one pin (signal) from a second digital input.
Make sure that the BLUE wire goes into digital input 1 through 6; then, using Kevin Watson's encoder code (
www.kevin.org/frc), go through the step-by-step instructions in the readme file to get it working. Remember where you plugged in each signal (blue and yellow) cable when you work through it.