Outline:
I'm trying to work with an Arduino and Analog thumb stick to get values for a simple differential drive robot I'm working on. The Keyes_Sjoys Arduino Joystick Module I have in my possession is giving me some strange numbers however.
Following axises Data I have:
- X-axis range of 0 to a shaky 470-520 with a center value of 40.
- Y-axis range of a solid 4 to solid 1023 with a center value of 605.
Problem
I haven't used analog sensors before but it seems pretty obvious that my X-axis ranges should feel somewhat similar to the Y-axis but they don't. In addition, the X-axis hits zero way way before even coming close to the edge for its operating range.
Is my sensor plain broke (it's new), or is there some way I can recalibrate the potentiometer?
Update 1: Wiring is the same as in this tutorial, and I used the same code, just added another analog input. http://arduino.cc/en/Tutorial/AnalogReadSerial
void setup(){
Serial.begin(9600);
}
void loop(){
int X = analogRead(A0);
int Y = analogRead(A1);
Serial.print("X = ");
Serial.print(X);
Serial.print(" Y = ");
Serial.println(Y);
delay(3);
}