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
sometimes the sensor hangs, resetting or init doesn´t solve the problem. There are 2 ways to solve the problem:
powercycle the sensor
modify the Data_Ready method as shown below
bool QMC5883LCompass::Data_Ready () {
Wire.beginTransmission ( _ADDR ) ;
Wire.write ( 0x06 ) ;
int err = Wire.endTransmission();
if (!err) {
Wire.requestFrom(_ADDR, (byte)1);
uint8_t Status = Wire.read() ;
if ( ( Status & 0x01 ) > 0 ) return true ;
// *********************************************************************
//SM: to prevent hangup, if skipbit DOR (0x04) is set
// youe to perform a read to get it working again (but data will be invalid)
if ( ( Status & 0x04 ) > 0 ) read() ;
// *********************************************************************
}
return false ;
}
The text was updated successfully, but these errors were encountered:
sometimes the sensor hangs, resetting or init doesn´t solve the problem. There are 2 ways to solve the problem:
bool QMC5883LCompass::Data_Ready () {
Wire.beginTransmission ( _ADDR ) ;
Wire.write ( 0x06 ) ;
int err = Wire.endTransmission();
if (!err) {
Wire.requestFrom(_ADDR, (byte)1);
uint8_t Status = Wire.read() ;
if ( ( Status & 0x01 ) > 0 ) return true ;
// *********************************************************************
//SM: to prevent hangup, if skipbit DOR (0x04) is set
// youe to perform a read to get it working again (but data will be invalid)
if ( ( Status & 0x04 ) > 0 ) read() ;
// *********************************************************************
}
return false ;
}
The text was updated successfully, but these errors were encountered: