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.
main.cpp
- Committer:
- RyotaNakamura
- Date:
- 2017-02-10
- Revision:
- 0:703868f31291
File content as of revision 0:703868f31291:
#include "mbed.h" #include "MPU6050.h" #define acc 16384 DigitalOut myled(LED1); MPU6050 mpu(D4,D5); Serial pc(USBTX, USBRX); Timer timer; int main(){ float a[3]; int miri=1000; mpu.setAcceleroRange(0); while(1) { wait(1); myled = 1; wait(0.2); myled = 0; wait(0.2); timer.reset(); timer.start(); a[0] = (float)mpu.getAcceleroRawX()/acc; timer.stop(); float t=timer.read(); float time=t*miri; pc.printf("time= %f ms\n",time); } }