Closed Azz1 closed 9 years ago
This is consistent with the chip. The accelerometer outputs XYZ data but the magnetometer outputs XZY (see the Arduino driver by way of comparison): https://github.com/adafruit/Adafruit_LSM303DLHC/blob/master/Adafruit_LSM303_U.cpp#L291
Looks like the reading of magnetic sensor is in X, Z, Y order instead of X, Y, Z. Not a big issue :-)
... Adafruit/Adafruit_LSM303.py res.append((self.mag16(list, 0), # X self.mag16(list, 2), # Z self.mag16(list, 4), # Y 0.0 )) # ToDo: Calculate orientation