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
00001 #include "mbed.h" 00002 #include "MPU6050.h" 00003 00004 DigitalOut myled(LED1); 00005 MPU6050 mpu(p9,p10); 00006 Serial pc(USBTX, USBRX); 00007 00008 int main() { 00009 float a[3]; 00010 float g[3]; 00011 mpu.setAcceleroRange(0); 00012 mpu.setGyroRange(0); 00013 while(1) { 00014 myled = 1; 00015 wait(0.2); 00016 myled = 0; 00017 wait(0.2); 00018 mpu.getAccelero(a); 00019 mpu.getGyro(g); 00020 pc.printf("%4.3f,%4.3f,%4.3f,%4.3f,%4.3f,%4.3f\r\n",a[0],a[1],a[2],g[0],g[1],g[2]); 00021 } 00022 }
Generated on Thu Jul 14 2022 21:23:14 by
1.7.2