Library thread Blink Led or other processes use RTOS

Dependents:   LedsThreading

Fork of BlinkLed by Satoshi Togawa

Example

https://developer.mbed.org/users/AVELARDEV/code/LedsThreading/

BlinkLed.h

Committer:
AVELARDEV
Date:
2016-05-25
Revision:
4:3b34689ec230
Parent:
3:f317d057edde

File content as of revision 4:3b34689ec230:

/* BlinkLed.h */
#ifndef BLINKLED_H_
#define BLINKLED_H_

#include "mbed.h"
#include "rtos.h"

/** LED which blinks automatically with RTOS
*/
class BlinkLed
{
public:
    /** Constructor
     */
    BlinkLed(PinName, int);
    
    /** Destructor
     */
    ~BlinkLed();
    
    /** Start biinking
     */
    void startBlink();
      
private:   
    /** Function for blinking
     *  This function will be bind to new thread
     */
    static void blink(void const *argument);
    
    /** Target Led
     */
    DigitalOut led;
    
    /** Blink time
     */
    int n;
    
    /** Pointer to thread for blinking
     */
    Thread* thread;
};

#endif /* BLINKLED_H_ */