I've just bought the LSM303 https://www.sparkfun.com/products/10888
It should have been an easy process to calibrate the compass with the library https://github.com/pololu/LSM303
, but certainly not for me.
When I use the "calibrate" sketch included in the library, which reads the max/min value from the compass, I'm just getting minimal changes in the values,if any at all, even tough I rotate every axis:
M min X: -8 Y: -4096 Z: -256 M max X: 16 Y: 3 Z: 3
and this happens after a while if I do nothing at all:
M min X: -255 Y: -4096 Z: -256 M max X: 16 Y: 4 Z: 255
So instead I've been trying the "serial" sketch, which just reads the raw data from the compass.
From that data, I've noticed that the values from the accelerometer do change, while the values from the magnetic sensor pretty much stand still, just like the calibration-values:
A X: 786 Y: 483 Z: 447 M X: -2 Y: -4096 Z: -1
A X: 775 Y: 477 Z: 431 M X: -2 Y: -4096 Z: 0
A X: 772 Y: 480 Z: 437 M X: -2 Y: -4096 Z: -3
A X: 764 Y: 469 Z: 439 M X: -2 Y: -4096 Z: -1
What have gone wrong here? Could the magnetic-sensor on the compass have been damaged or something?
All help and suggestions is appreciated!
The compass was shipped together with a vacuum pump and a liquid pump, who both cause pretty decent magnetic fields with values over 1000 microTesla (measured with phone).
Could this have damaged the magnetic sensor on the compass?..