![](/media/cache/profiles/sample02.jpg.50x50_q85.jpg)
accel.v2
Dependencies: mbed MPU6050 Math
Diff: main.cpp
- Revision:
- 0:4ba3fa671062
- Child:
- 1:958b581f6d21
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Oct 19 15:03:37 2018 +0000 @@ -0,0 +1,14 @@ +#include "mbed.h" +#include "MPU6050.h" + +DigitalOut myled(LED1); +MPU6050 mpu(p9,p10);//(SDA,SCL) + +int main() { + while(1){ + int accel[3];//accel配列 + mpu.readAccelData(accel);//accel[3]に代入 + printf("accel x:%d y:%d z:%d\r\n %d",accel[0],accel[1],accel[2],x); + wait(0.05); + } +}