k64f_OneNET
Dependencies: EthernetInterface FXOS8700Q eCompass_FPU_Lib mbed-rtos mbed mbed
Fork of K64F_eCompass by
Diff: main.cpp
- Revision:
- 3:d6404f10bd3b
- Parent:
- 2:51f3303cbefd
- Child:
- 4:ad29ae25685c
--- a/main.cpp Fri May 09 16:23:09 2014 +0000 +++ b/main.cpp Fri May 09 16:30:47 2014 +0000 @@ -67,6 +67,7 @@ seconds++; sflag = 1; compass.calibrate(); + debug_print(); l = 0; led = !led; } @@ -82,7 +83,7 @@ } } -*/ + void print_thread(void const *argument) { while (true) { @@ -91,35 +92,24 @@ debug_print(); // re-calibrate the eCompass every second } } - + */ int main() { -//Thread calibrate(calibrate_thread); -Thread dprint(print_thread); -//RtosTimer compass_timer(compass_thread, osTimerPeriodic); +RtosTimer compass_timer(compass_thread, osTimerPeriodic); //cdebug = 1; // uncomment to disable compass printf("\r\n\n\n\n\n\n\n"); +printf("Who AM I= %X\r\n", acc.whoAmI()); acc.enable(); -printf("Who AM I= %X\r\n", acc.whoAmI()); + acc.getAxis( acc_raw); mag.getAxis( mag_raw); -dprint.set_priority(osPriorityLow); -//calibrate.set_priority(osPriorityBelowNormal); -//compass_timer.set_priority(osPriorityRealtime); - -//compass_timer.start(20); // Run the Compass every 20ms +compass_timer.start(20); // Run the Compass every 20ms while(1) { - //while(!sflag); - sflag = 0; - //debug_print(); - printf("\r\nL\r\n"); - //calibrate.signal_set(0x1); - dprint.signal_set(0x1); - wait(1000); + Thread::wait(osWaitForever); } }