Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solving hangup of the sensor (in continuous mode) #9

Open
Stef-aap opened this issue Apr 24, 2021 · 2 comments
Open

solving hangup of the sensor (in continuous mode) #9

Stef-aap opened this issue Apr 24, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@Stef-aap
Copy link

sometimes the sensor hangs, resetting or init doesn´t solve the problem. There are 2 ways to solve the problem:

  1. powercycle the sensor
  2. 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 ;
}

@capedra
Copy link

capedra commented May 22, 2021

I can't find this Data_Ready function anywhere.

@mprograms mprograms added the enhancement New feature or request label Dec 23, 2021
@ZIVsc
Copy link

ZIVsc commented Feb 5, 2023

where is this data_Ready function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants