Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: AHRS mbed-rtos mbed
Fork of RazorAHRS by
main.cpp@4:12eb2834abbd, 2012-11-08 (annotated)
- Committer:
- tylerjw
- Date:
- Thu Nov 08 20:16:34 2012 +0000
- Revision:
- 4:12eb2834abbd
- Parent:
- 3:c2d895d76e75
not working - no valid source code
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| tylerjw | 3:c2d895d76e75 | 1 | #include "mbed.h" | 
| tylerjw | 3:c2d895d76e75 | 2 | #include "AHRS.h" | 
| tylerjw | 3:c2d895d76e75 | 3 | #include "rtos.h" | 
| tylerjw | 3:c2d895d76e75 | 4 | |
| tylerjw | 3:c2d895d76e75 | 5 | IMU imu; | 
| tylerjw | 3:c2d895d76e75 | 6 | Serial pc(USBTX, USBRX); | 
| tylerjw | 3:c2d895d76e75 | 7 | |
| tylerjw | 3:c2d895d76e75 | 8 | void imu_thread(void const *arg) | 
| tylerjw | 3:c2d895d76e75 | 9 | { | 
| tylerjw | 3:c2d895d76e75 | 10 | float data[4]; | 
| tylerjw | 3:c2d895d76e75 | 11 | imu.loop(data); | 
| tylerjw | 3:c2d895d76e75 | 12 | pc.printf("#YPR=%f,%f,%f\t%f\r\n", data[1],data[2],data[3],data[0]); | 
| tylerjw | 3:c2d895d76e75 | 13 | } | 
| tylerjw | 3:c2d895d76e75 | 14 | |
| tylerjw | 3:c2d895d76e75 | 15 | int main() | 
| tylerjw | 3:c2d895d76e75 | 16 | { | 
| tylerjw | 3:c2d895d76e75 | 17 | pc.baud(9600); | 
| tylerjw | 3:c2d895d76e75 | 18 | |
| tylerjw | 3:c2d895d76e75 | 19 | RtosTimer ahrs_timer(imu_thread, osTimerPeriodic, NULL); | 
| tylerjw | 3:c2d895d76e75 | 20 | ahrs_timer.start(20); | 
| tylerjw | 3:c2d895d76e75 | 21 | |
| tylerjw | 3:c2d895d76e75 | 22 | while (1); | 
| tylerjw | 3:c2d895d76e75 | 23 | } | 
