9dofRazor for near space flight project
Fork of 9dofRazorImuAhrs by
main.cpp
- Committer:
- dhansen17
- Date:
- 2016-04-07
- Revision:
- 1:f2736d5ba512
- Parent:
- 0:ef171fe2a7e5
- Child:
- 2:add8059b69fa
File content as of revision 1:f2736d5ba512:
/** * Read the yaw value from the SparkFun 9DOF Razor IMU. */ #include "dof9RazorImuAhrs.h" #include "mbed.h" Serial pc(USBTX, USBRX); dof9RazorImuAhrs theRazor(p27, p28); const float g = 9.8; int main() { 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); } }