only test purpose not official
Revision 7:0414b9099641, committed 2020-02-07
- Comitter:
- kenjiArai
- Date:
- Fri Feb 07 00:53:03 2020 +0000
- Parent:
- 6:c97ae96fea8f
- Commit message:
- only test purpose not official
Changed in this revision
LPS22HB.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r c97ae96fea8f -r 0414b9099641 LPS22HB.cpp --- a/LPS22HB.cpp Mon Jul 10 01:15:03 2017 +0000 +++ b/LPS22HB.cpp Fri Feb 07 00:53:03 2020 +0000 @@ -106,6 +106,19 @@ return temp; } +/////////////// Check data ready ////////////////////////// +uint8_t LPS22HB::data_ready() +{ + dt[0] = LPS22HB_STATUS_REG; + _i2c.write(LPS22HB_addr, dt, 1, true); + _i2c.read(LPS22HB_addr, dt, 1, false); + if (dt[0]) { + return 1; + } else { + return 0; + } +} + /////////////// ID //////////////////////////////////////// uint8_t LPS22HB::read_id() {