Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
ADXL375 Class Reference
3軸高加速度センサADXL375のライブラリ More...
#include <PQADXL375.h>
Public Member Functions | |
| ADXL375 (I2C &i2c, ALT_ADDRESS_t ALT_ADDRESS) | |
| void | begin () |
| センサ動作開始 | |
| bool | test () |
| センサ通信テスト | |
| void | offset (float *high_accel) |
| ゼロ点補正 | |
| void | read (float *high_accel) |
| 測定値の読み取り | |
Detailed Description
3軸高加速度センサADXL375のライブラリ
#include "mbed.h" #include "PQADXL375.h" Serial pc(USBTX, USBRX, 115200); I2C i2c(p9, p10); ADXL375 adxl(i2c, ADXL375::ALT_ADDRESS_HIGH); float high_accel_offset[] = {0, 0, 0}; float high_accel[3]; int main() { adxl.begin(); adxl.offset(high_accel); if(adxl.test()){ adxl.read(high_accel); pc.printf("%f\t%f\t%f\r\n", high_accel[0], high_accel[1], high_accel[2]); } else{ pc.printf("[ FAIL ] ADXL375 cannot be reached.\r\n"); } }
Definition at line 40 of file PQADXL375.h.
Constructor & Destructor Documentation
| ADXL375 | ( | I2C & | i2c, |
| ALT_ADDRESS_t | ALT_ADDRESS | ||
| ) |
- Parameters:
-
i2c I2Cのインスタンスへの参照 ALT_ADDRESS_t ALT_ADDRESSピンのH/Lレベル
Definition at line 4 of file PQADXL375.cpp.
Member Function Documentation
| void begin | ( | ) |
センサ動作開始
Definition at line 11 of file PQADXL375.cpp.
| void offset | ( | float * | high_accel ) |
| void read | ( | float * | high_accel ) |
| bool test | ( | ) |
Generated on Sun Jul 17 2022 10:35:44 by
1.7.2