MinIMU-9

You might find this forum post relevant to your problem.

In your magnetometer code where you do:

            _rawData.x = (xhm << 8 | xlm);
            _rawData.y = (yhm << 8 | ylm);
            _rawData.z = (zhm << 8 | zlm);

It should probably be:

            _rawData.x = (Int16)(xhm << 8 | xlm);
            _rawData.y = (Int16)(yhm << 8 | ylm);
            _rawData.z = (Int16)(zhm << 8 | zlm);

Can you try that and see if it helps? If it does, can you try applying the same principle to the other sensor conversions?

- Ryan