This Library allows you to use any pin on the mbed micro as PWM out. It also allows the user to update the Period and Pulse width in realtime.
Diff: PwmOutAny.h
- Revision:
- 0:9eb94736e774
diff -r 000000000000 -r 9eb94736e774 PwmOutAny.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PwmOutAny.h Sun Dec 08 19:04:44 2013 +0000 @@ -0,0 +1,20 @@ +#include "mbed.h" + + +class PwmOutAny { +public: + + PwmOutAny(PinName pin1, float Period, float PercentHigh); + + float Get_PulseWidth(); + void Set_PulseWidth(float PW); + float Get_Period(); + void Set_Period(float ChangePeriod); + + +private: + void TickerFlipper(); + Ticker _PwmTicker; + DigitalOut _PwmOut; + +};