Function on LEDs
Diff: LEDFunction.h
- Revision:
- 0:38ffbf6895c1
- Child:
- 1:7fd22984c201
diff -r 000000000000 -r 38ffbf6895c1 LEDFunction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LEDFunction.h Mon May 28 02:58:18 2012 +0000 @@ -0,0 +1,28 @@ +#ifndef MBED_LEDFUNCTION_H +#define MBED_LEDFUNCTION_H + +#include "mbed.h" + +class LEDFunction{ + +public: + LEDFunction(PinName); + void OnOff(); + void Brightness(int); + void write_us(int); + void duty(float); + int read_us(); + +private: + void SigStart(); + void SigStop(); + DigitalOut _Pin; + int Period; + int PWMDuty; + int PWMMin; + int PWMMax; + Ticker Pulse; + Timeout PulseEnd; +}; + +#endif \ No newline at end of file