9dofRazor for near space flight project

Dependencies:   mbed

Fork of 9dofRazorImuAhrs by Aaron Berk

main.cpp

Committer:
szeitler18
Date:
2016-04-07
Revision:
2:add8059b69fa
Parent:
1:f2736d5ba512

File content as of revision 2:add8059b69fa:

/**
 * Read the yaw value from the SparkFun 9DOF Razor IMU.
 */

#include "dof9RazorImuAhrs.h"
#include "mbed.h"

Serial pc(USBTX, USBRX);
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) {
        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());
          
    }
    
}