Quadcopter software. Flying - Contact me for more details or a copy of the PC ground station code
Dependencies: ConfigFile PID PPM MODSERIAL mbed-rtos mbed MaxbotixDriver TinyGPS filter
Diff: statusLights.h
- Revision:
- 6:4c207e7b1203
- Parent:
- 3:82665e39f1ea
--- a/statusLights.h Mon Sep 22 10:16:31 2014 +0000 +++ b/statusLights.h Thu Jan 22 18:03:22 2015 +0000 @@ -2,38 +2,22 @@ #include "rtos.h" #include "hardware.h" -//Declarations -void StatusLightsTask(void const *n); - -//Timers -RtosTimer *_statusLightsUpdateTimer; - // The status thread indicates the current system status to the user void StatusThread(void const *args) { - //Update Timer - _statusLightsUpdateTimer = new RtosTimer(StatusLightsTask, osTimerPeriodic, (void *)0); - int updateTime = (1.0 / STATUS_LIGHTS_FREQUENCY) * 1000; - _statusLightsUpdateTimer->start(updateTime); + printf("Status lights thread started\r\n"); - // Wait here forever - Thread::wait(osWaitForever); -} - -void StatusLightsTask(void const *n) -{ int ledState = 0; while (true) { ledState++; - if (ledState > 5) - { - ledState = 0; - } + if (ledState > 5) { ledState = 0; } _led1 = (ledState == 0); _led2 = (ledState == 1 || ledState == 5); _led3 = (ledState == 2 || ledState == 4); _led4 = (ledState == 3); + + Thread::wait(100); } -} \ No newline at end of file +}