Function on LEDs

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LEDFunction.h Source File

LEDFunction.h

00001 #ifndef MBED_LEDFUNCTION_H
00002 #define MBED_LEDFUNCTION_H
00003 #include "mbed.h"
00004 
00005 class LEDFunction{
00006 
00007 public:
00008     LEDFunction(PinName);
00009     void write_us(int);
00010     void duty(float);
00011     void OnOff();
00012     void flash(int);
00013     int read_us();
00014 
00015 private:
00016     void SigStart();
00017     void SigStop();
00018     DigitalInOut _pin;
00019     int Period;
00020     int PWMDuty;
00021     int PWMMin;
00022     int PWMMax;
00023     int i;
00024     Ticker Pulse;
00025     Timeout PulseEnd;
00026 };
00027 
00028 #endif