From Jeremy S Cook on the Tindie blog:
Rotary Encoder with I2C Interface and RGB Lighting
Makernet Knob’s makes the point that “Rotary encoders are cool but hard to wire into your projects.” Having wired up a custom input device for my computer using an encoder, I can attest to both of these statements. In my case, it took me quite a bit of time simply to figure out how each encoder pin was used!