Hello everybody.

I bought a MMA7361L accelerometer for a controller project.

I tried to read the X, Y and Z with my Arduino Uno.

Then I found out the X axis (in a horizontal stand by) is shifted around 1°.

Here is the code I used. A simple SerialReader from the ardunio examples librery.

I devided the 3 axis by 1000 to have an easy-to-read result.

```
/*
AnalogReadSerial
Reads an analog input on pin 0, prints the result to the serial monitor.
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
This example code is in the public domain.
*/
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue1 = analogRead(A0);
// read the input on analog pin 1:
int sensorValue2 = analogRead(A1);
// read the input on analog pin 2:
int sensorValue3 = analogRead(A2);
// read the input on analog pin 19:
int sensorValue4 = analogRead(19);
// print out the value you read:
Serial.print("\t");
Serial.print("\t");
Serial.print(" X = ");
Serial.print(sensorValue1 / 100);
Serial.print("\t");
Serial.print("\t");
Serial.print(" Y = ");
Serial.print(sensorValue2 / 100);
Serial.print("\t");
Serial.print("\t");
Serial.print(" Z = ");
Serial.print(sensorValue3 / 100);
Serial.print("\t");
Serial.print("\t");
Serial.println();
delay(0.0001); // delay in between reads for stability
}
```

Now, below is the result from the Serial Monitor.

You can see the X axis at 3. I thaught it would be 1 or 0.

```
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 2
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 2
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 2
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 2
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 2
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 2
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 2
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 2
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 2
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 2
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 2
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 2
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 1
```

Then, this is the results when I lean the accelerometer from horizontal to the left, back to horizontal, then to right and back to horizontal.

```
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 4
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 3
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 2
X = 3 Y = 1 Z = 2
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 4
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 4
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 4
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 4
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 2
X = 3 Y = 1 Z = 2
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 3
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 4
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 4
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 4
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 3
X = 3 Y = 1 Z = 2
X = 3 Y = 1 Z = 2
X = 3 Y = 1 Z = 3
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 4
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 4
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 4
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 3
X = 3 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1 Z = 1
X = 3 Y = 1 Z = 4
X = 3 Y = 1 Z = 0
X = 3 Y = 1 Z = 4
X = 3 Y = 1 Z = 0
X = 3 Y = 1 Z = 3
X = 3 Y = 1 Z = 1
X = 3 Y = 1 Z = 3
X = 3 Y = 2 Z = 1
```

So as you can see, the X axis goes this way (witch I think is wrong or bad shifted)

^3 / <4 / ^3 / >1 / ^3.

if I lean it by the left or wright too much and exceed the very vertical “0”, it goes like I was doing the opposite movement.

Testing the MMA7361L in my project, when I turn to the left or right, in both case the processing test turns left.

Do I have to calibrate somehow the MMA7361L or change my accelerometer ?

If someone has a solution, I take.

Thanks.