Hi I'm using the BMM150 to get earth compass read How to convert the X,Y,Z values to 0-360 compass heading read? Do I need to calibrate the BMM150 to improve the readout values? I set the following configuration using i2c: Register 0x4B Value 0x01 (Power) Register 0x4E Value 0x87 (Enable Data Ready bit) Register 0x4E Value 0x4C(Normal mode) Reading sequnse + parsing raw data: When Data Ready Status bit is 1 read 6 byte from register 42 into buffer x_raw[0] = (buffer[1] << 5) | (buffer[0] >> 3); // x y_raw[1] = (buffer[3] << 5) | (buffer[2] >> 3); // y xyHeading = atan2(x_raw[0], y_raw[1]); if(xyHeading < 0) xyHeading += 2*PI; if(xyHeading > 2*PI) xyHeading -= 2*PI; deg = xyHeading * 180/PI; I getting the same problem with every read call and the deg is alyaws 45 degrees regardless the location of the sensor in space. Appreciate any help
... View more