Skip to content

Instantly share code, notes, and snippets.

@reefwing
Last active April 8, 2023 08:14
Show Gist options
  • Save reefwing/acc65edebabb246170cb7b15a05fc1b2 to your computer and use it in GitHub Desktop.
Save reefwing/acc65edebabb246170cb7b15a05fc1b2 to your computer and use it in GitHub Desktop.
void ReefwingLSM9DS1::reset() {
writeByte(LSM9DS1AG_ADDRESS, LSM9DS1AG_CTRL_REG8, 0x05);
writeByte(LSM9DS1M_ADDRESS, LSM9DS1M_CTRL_REG2_M, 0x0c);
delay(20);
// Check that chip boot up is complete - bit 3 is BOOT_STATUS
// Mask the STATUS_REG with 0b00001000 = 0x08
while ((readByte(LSM9DS1AG_ADDRESS, LSM9DS1AG_STATUS_REG) & 0x08) != 0) {
yield();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment