Skip to content

Instantly share code, notes, and snippets.

@reefwing
Created February 19, 2023 06:41
Show Gist options
  • Save reefwing/133c03dfb99b9a6b7300fe88c5ec1487 to your computer and use it in GitHub Desktop.
Save reefwing/133c03dfb99b9a6b7300fe88c5ec1487 to your computer and use it in GitHub Desktop.
LPS22HB Who Am I Stub
byte ReefwingLPS22HB::whoAmI() {
Wire1.beginTransmission(_address);
Wire1.write(LPS22HB_WHO_AM_I);
Wire1.endTransmission();
Wire1.requestFrom(_address, 1);
return Wire1.read();
}
bool ReefwingLPS22HB::connected() {
return (whoAmI() == LPS22HB_WHO_AM_I_VALUE);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment