PLANET-Q ADXL375 Library
Revision 2:b5fd8584fd83, committed 2019-12-17
- Comitter:
- tanahashi
- Date:
- Tue Dec 17 13:43:21 2019 +0000
- Parent:
- 1:7fdf6d2e8a9b
- Commit message:
- fix
Changed in this revision
PQADXL375.cpp | Show annotated file Show diff for this revision Revisions of this file |
PQADXL375.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 7fdf6d2e8a9b -r b5fd8584fd83 PQADXL375.cpp --- a/PQADXL375.cpp Tue Dec 17 13:14:53 2019 +0000 +++ b/PQADXL375.cpp Tue Dec 17 13:43:21 2019 +0000 @@ -13,7 +13,7 @@ cmd[0] = ADXL375_BW_RATE; cmd[1] = 0x0F; _i2c->write(_addr, cmd, 2); - + cmd[0] = ADXL375_POWER_CTL; cmd[1] = 0x08; _i2c->write(_addr, cmd, 2);
diff -r 7fdf6d2e8a9b -r b5fd8584fd83 PQADXL375.h --- a/PQADXL375.h Tue Dec 17 13:14:53 2019 +0000 +++ b/PQADXL375.h Tue Dec 17 13:43:21 2019 +0000 @@ -44,39 +44,39 @@ ALT_ADDRESS_HIGH = ADXL375_ADDR_HIGH, ALT_ADDRESS_LOW = ADXL375_ADDR_LOW } ALT_ADDRESS_t; - + private: I2C *_i2c; int _addr; char cmd[2]; char buff[6]; float high_accel_offset[3]; - -public: + +public: /** * @param i2c I2Cのインスタンスへの参照 * @param ALT_ADDRESS_t ALT_ADDRESSピンのH/Lレベル */ ADXL375(I2C &i2c, ALT_ADDRESS_t ALT_ADDRESS); - + /** * センサ動作開始 */ void begin(); - + /** * センサ通信テスト * @retval true 通信成功 * @retval false 通信失敗 */ bool test(); - + /** * ゼロ点補正 * @param high_accel 高加速度のオフセット配列 */ void offset(float *high_accel); - + /** * 測定値の読み取り * @param high_accel 高加速度を格納する配列