Rotary Encoder E6B2... How can i connect to Arduino?

Hi all guys, i've bought the E6B2-CWZ3E (https://www.sparkfun.com/products/11102) and i don't know how to connect the Encoder to my Arduino Mega (too much wires... 6) :o Can you help me? I can't find examples for code and connection on Google :(

Thanks :D

If you look at the Sparkfun product page which you linked, there is a picture of the label describing the wire colors and what they are. Smeld is obviously the braided shield. What part of this do you not understand?

Hi, sorry for the long time passed.

The problem is related to normal arduino connection (sorry but the cheatsheet is a little bit hard to understand)

This is the detailed connection wiring:

Brown -> 5V of Arduino Mega 2560 Blue -> ??? I don't know Shield -> ??? I don't know

Black -> Digital 5 White -> Digital 6 Orange -> I don't know because i can't find a script that uses Z :O

Can you help me? I need to use resistors before the input to Digital In?

Thaks :D

Blue and Shield go the ground. Connect orange to an unused digital pin, until you figure out it you want to do anything with it. I can't see the data sheet very well but it looks like it give one long pulse equal to the length of one quadrature cycle.

I need to use resistors before the input to Digital In?

The way I read the data sheet is that the output pulse will be determined by the input voltage (5-12V), and since you are using 5v on the brown, you can take the A/B signals direct to a digital 5/6.

Many thanks, it works! ;D