AHRS with RTOS
Dependencies: AHRS mbed-rtos mbed
Fork of RazorAHRS by
Diff: main.cpp
- Revision:
- 3:c2d895d76e75
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Nov 08 18:57:58 2012 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" +#include "AHRS.h" +#include "rtos.h" + +IMU imu; +Serial pc(USBTX, USBRX); + +void imu_thread(void const *arg) +{ + float data[4]; + imu.loop(data); + pc.printf("#YPR=%f,%f,%f\t%f\r\n", data[1],data[2],data[3],data[0]); +} + +int main() +{ + pc.baud(9600); + + RtosTimer ahrs_timer(imu_thread, osTimerPeriodic, NULL); + ahrs_timer.start(20); + + while (1); +} \ No newline at end of file