Joseph Roberts / Mbed 2 deprecated QuadCopter

Dependencies:   ConfigFile PID PPM MODSERIAL mbed-rtos mbed MaxbotixDriver TinyGPS filter

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers statusLights.h Source File

statusLights.h

00001 #include "mbed.h"
00002 #include "rtos.h"
00003 #include "hardware.h"
00004 
00005 // The status thread indicates the current system status to the user
00006 void StatusThread(void const *args) 
00007 {
00008     printf("Status lights thread started\r\n");
00009     
00010     int ledState = 0;
00011     while (true) 
00012     {
00013         ledState++;
00014         if (ledState > 5) { ledState = 0; }
00015         
00016         _led1 = (ledState == 0);
00017         _led2 = (ledState == 1 || ledState == 5);
00018         _led3 = (ledState == 2 || ledState == 4);
00019         _led4 = (ledState == 3);
00020         
00021         Thread::wait(100);
00022     }
00023 }