accelerometer calibration

Hi everybody

I never used an accelerometer before so sorry for the ignorance... I bought an accelerometer MMA7361L to read angle of a device rotated by a servo motor in 2d xy plane.

The accelerometer seems to be working except the calibration seems to be quite off meaning: x and y seem to have quite different zeros (ie V output for their 0g) and a bit different range of V between 0 and 1 g. Is this normal? If it is, is there an easy quick way to calibrate it quite precisely? (I am using the accelerometer to increase the precision of angle of the servo and right now the angle I could get from it would be reaaaly approximate due this calibration problem).

I also tried using the suggested library but I get 0g x value at an angle of about 30deg (???)

Thanks for the help

Accelerometers need to be calibrated for best performance, as each axis is slightly different. Here is a simple procedure

Here is a better one

These are for magnetometers, but they work just as well for accelerometers as long as the accelerometer is held still for each reading.