What kind of input is used to connect an encoder? (NEWBIE)

I need to connect a rotary encoder to Arduino.

what kind of input is used to connect an encoder, analog o digital?

Some example?

Thanks!

MickyMike:
I need to connect a rotary encoder to Arduino.

What type?

I need to connect one like this https://www.sparkfun.com/products/9117

You can use any but most driver libraries require it to be connected to D2 and D3.

..any port u like!
Google "encoder library"

For an encoder like that, namely mechanical switch, digital inputs will do, but you have
to be wary of contact-bounce - this means you must use an encoder library or code that
counts every transition on both A and B signals or risk miscounting. (Alternatively sample
the inputs at a high enough rate to never miss one of the states).

For optical encoders with analog outputs, the best approach is signal-conditioning circuitry,
usually 74HC14 schmitt-trigger inverters to clean up the analog output to a digital logic
signal (While you could use the ADC for this, its possibly not fast enough and wasteful of
resources).

For generic encoder units you typically get open-collector logic outputs, so INPUT_PULLUP
is your friend (as it is with such rotary switches).