Analog input Problem

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 ?

you can check the A2 by coinnecting it to +5V and to GND alternatingly
It should give approx. 1023 and 0 as value from analogRead(A2)

When i connect 5v to A2 and then plugin USB cable,arduino is dead,power led is dead.
when i disconnect A2,ti works.
With GND and A0,arduino power led works,but can't connect with hyper trminal.
Is A2 burned ? :open_mouth: can i fix that or i have to buy new board ?

THX a lot ! :blush:

If this is an UNO you can buy a new 328 controller I.C.