I am trying to read the output from a MA3 encoder (link below) it is a 10-bit version.
http://www.usdigital.com/products/encoders/absolute/rotary/shaft/ma3I have the basic idea of how this should be done through arduino code, but maybe I am missing something. All I want to do is read the values coming off of the encoder through the serial monitor. Seems straight forward, but when I run the code I the number changes from 300-360 randomly without any motion of the shaft. My code is pasted below.
int enc = 10;
int x = 0;
void setup()
{
pinMode(enc, INPUT);
Serial.begin(9600);
}
void loop()
{
x = analogRead(enc);
Serial.println(x);
delay(1000);
}
Any help would be much appreciated. I am doing this basic code so I can know how to construct the LabView code which will be used in a larger project I am working on. Thanks.