You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code for magnetometer reading must be fixed. The byte order is incorrect according to datasheet. The code should read:
`/**
@brief Read readings from magnetometer.
*/
void MPU9255::read_mag()
{
requestBytes(MAG_address, MAG_XOUT_L, 8);//note we must request 8 bytes of data because otherwise it does not work
The code for magnetometer reading must be fixed. The byte order is incorrect according to datasheet. The code should read:
`/**
*/
void MPU9255::read_mag()
{
requestBytes(MAG_address, MAG_XOUT_L, 8);//note we must request 8 bytes of data because otherwise it does not work
uint8_t rawData[6];
readArray(rawData,6);
mx = ((int16_t)rawData[1] << 8) | rawData[0];
my = ((int16_t)rawData[3] << 8) | rawData[2];
mz = ((int16_t)rawData[5] << 8) | rawData[4];
}
`
The text was updated successfully, but these errors were encountered: