9dofRazor for near space flight project
Fork of 9dofRazorImuAhrs by
main.cpp
00001 /** 00002 * Read the yaw value from the SparkFun 9DOF Razor IMU. 00003 */ 00004 00005 #include "dof9RazorImuAhrs.h" 00006 #include "mbed.h" 00007 00008 Serial pc(USBTX, USBRX); 00009 dof9RazorImuAhrs theRazor(p9, p10); 00010 DigitalOut led1(LED1); 00011 DigitalOut led2(LED2); 00012 00013 const float g = 9.8; 00014 float x; 00015 00016 int main() { 00017 pc.printf("I'm alive!\r\n"); 00018 while(1) { 00019 pc.printf("Hi!\r\n"); 00020 led2 = 1; 00021 wait(1); 00022 led2 = 0; 00023 theRazor.update(); 00024 x = theRazor.getAccX(); 00025 pc.printf("ax = %.2f\r\n",x); 00026 pc.printf("ax = %.2fg, ay = %.2fg, az = %.2fg\r\n", theRazor.getAccX(),theRazor.getAccY(), theRazor.getAccZ()); 00027 //pc.printf("gyrox = %.2fg, gyroy = %.2fg, gyroz = %.2fg\r\n", theRazor.getGyroX() , theRazor.getGyroY() , theRazor.getGyroZ()); 00028 00029 } 00030 00031 }
Generated on Thu Jul 14 2022 15:58:09 by 1.7.2