Skip to content

Instantly share code, notes, and snippets.

@reefwing
Created April 4, 2023 07:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reefwing/1138b0694240cdda680778140c3fe13b to your computer and use it in GitHub Desktop.
Save reefwing/1138b0694240cdda680778140c3fe13b to your computer and use it in GitHub Desktop.
bool ReefwingLSM9DS1::gyroAvailable() {
uint8_t STATUS_REG = readByte(LSM9DS1AG_ADDRESS, LSM9DS1AG_STATUS_REG);
return (STATUS_REG & 0x02);
}
bool ReefwingLSM9DS1::accelAvailable() {
uint8_t STATUS_REG = readByte(LSM9DS1AG_ADDRESS, LSM9DS1AG_STATUS_REG);
return (STATUS_REG & 0x01);
}
bool ReefwingLSM9DS1::magAvailable() {
uint8_t STATUS_REG_M = readRegister(LSM9DS1M_ADDRESS, LSM9DS1M_STATUS_REG_M);
return (STATUS_REG_M & 0x08);
}
bool ReefwingLSM9DS1::tempAvailable() {
uint8_t STATUS_REG = readByte(LSM9DS1AG_ADDRESS, LSM9DS1AG_STATUS_REG);
return (STATUS_REG & 0x04);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment