9dofRazor for near space flight project
Fork of 9dofRazorImuAhrs by
Diff: main.cpp
- Revision:
- 2:add8059b69fa
- Parent:
- 1:f2736d5ba512
--- a/main.cpp Thu Apr 07 16:52:48 2016 +0000 +++ b/main.cpp Thu Apr 07 18:01:22 2016 +0000 @@ -6,15 +6,25 @@ #include "mbed.h" Serial pc(USBTX, USBRX); -dof9RazorImuAhrs theRazor(p27, p28); +dof9RazorImuAhrs theRazor(p9, p10); +DigitalOut led1(LED1); +DigitalOut led2(LED2); + const float g = 9.8; +float x; + int main() { - + pc.printf("I'm alive!\r\n"); while(1) { - wait(0.1); - theRazor.update(); - pc.printf("ax = %.2fg, ay = %.2fg, az = %.2fg\r\n", theRazor.getAccX()*g,theRazor.getAccY()*g, theRazor.getAccZ()*g); - pc.printf("gyrox = %.2fg, gyroy = %.2fg, gyroz = %.2fg\r\n", theRazor.getGyroX() *g, theRazor.getGyroY() *g, theRazor.getGyroZ() *g); + pc.printf("Hi!\r\n"); + led2 = 1; + wait(1); + led2 = 0; + theRazor.update(); + x = theRazor.getAccX(); + pc.printf("ax = %.2f\r\n",x); + pc.printf("ax = %.2fg, ay = %.2fg, az = %.2fg\r\n", theRazor.getAccX(),theRazor.getAccY(), theRazor.getAccZ()); + //pc.printf("gyrox = %.2fg, gyroy = %.2fg, gyroz = %.2fg\r\n", theRazor.getGyroX() , theRazor.getGyroY() , theRazor.getGyroZ()); }