気圧センサLPS22HBのライブラリ
Dependents: Hybrid_IZU2021_MAIN_OS5 Hybrid_IZU2021_MISSION_v2 Hybrid_IZU2021_MAIN Hybrid_IZU2021_MISSION
Diff: PQ_LPS22HB.cpp
- Revision:
- 1:fdde28032fb5
- Parent:
- 0:9a7d5d7e63be
--- a/PQ_LPS22HB.cpp Tue Dec 15 15:37:50 2020 +0000 +++ b/PQ_LPS22HB.cpp Mon Mar 08 16:48:54 2021 +0000 @@ -38,7 +38,7 @@ cmd[0] = LPS22HB_PRESS_XL; _i2c -> write(_addr, cmd, 1); _i2c -> read(_addr, buff, 3); - *press = (int)(buff[0] | buff[1] << 8 | buff[2] << 16) / 4096.0f; + *press = (int)(buff[0] | buff[1] << 8 | buff[2] << 16) / LPS22HB_PRESS_LSB; } void LPS22HB :: read_temp(float *temp) @@ -46,5 +46,5 @@ cmd[0] = LPS22HB_TEMP_L; _i2c -> write(_addr, cmd, 1); _i2c -> read(_addr, buff, 2); - *temp = (short)(buff[0] | buff[1] << 8) * 0.01; + *temp = (short)(buff[0] | buff[1] << 8) * LPS22HB_TEMP_LSB; } \ No newline at end of file