Hi, i get accelerometer and want to run it on arduino.
i used this code:
// Arduino code for using the MMA7361 Accelerometer Module
// Please feel free to copy, edit, distribute, sell, plagiarise ... Whatever you want :)
// A mention of Babelduck Cybernetics would be nice but is not necessary
// Written January 2012
char str[512]; // We will use this to construct a string to send with the readings
void setup()
{
Serial.begin(9600); // Start the serial link so we can see the output in the Arduino IDE
}
void loop()
{
int x, y, z; // Variables to store the 3 readings
x = analogRead(A0); // Read the X axis reading
y = analogRead(A1); // Read the Y axis reading
z = analogRead(A2); // Read the Z axis reading
sprintf(str, "%d \t %d \t %d", x, y, z); // Construct a string out of all three readings
Serial.println(str); // Print it to the serial link
}
Also i use hyperteminal to comunicate with arduino.
my reading from arduino are that i get x and y values,but z is always ZERO.
when i change code and start using A3 port. i got z component.
What is problem,why dosn't work with A2? Does it dead,how to chek ?