Eduardo Avelar / LibThreadProcess

Dependents:   LedsThreading

Fork of BlinkLed by Satoshi Togawa

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers BlinkLed.h Source File

BlinkLed.h

00001 /* BlinkLed.h */
00002 #ifndef BLINKLED_H_
00003 #define BLINKLED_H_
00004 
00005 #include "mbed.h"
00006 #include "rtos.h"
00007 
00008 /** LED which blinks automatically with RTOS
00009 */
00010 class BlinkLed
00011 {
00012 public:
00013     /** Constructor
00014      */
00015     BlinkLed(PinName, int);
00016     
00017     /** Destructor
00018      */
00019     ~BlinkLed();
00020     
00021     /** Start biinking
00022      */
00023     void startBlink();
00024       
00025 private:   
00026     /** Function for blinking
00027      *  This function will be bind to new thread
00028      */
00029     static void blink(void const *argument);
00030     
00031     /** Target Led
00032      */
00033     DigitalOut led;
00034     
00035     /** Blink time
00036      */
00037     int n;
00038     
00039     /** Pointer to thread for blinking
00040      */
00041     Thread* thread;
00042 };
00043 
00044 #endif /* BLINKLED_H_ */