Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of ele350 by
Revision 4:badd73a8d806, committed 2015-11-05
- Comitter:
- GGHHHH
- Date:
- Thu Nov 05 12:24:05 2015 +0000
- Parent:
- 3:1ad50b4e51a6
- Child:
- 5:e820e1348f98
- Commit message:
- ku
Changed in this revision
soft_pwm.h | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/soft_pwm.h Thu Nov 05 12:24:05 2015 +0000 @@ -0,0 +1,25 @@ +#ifndef _SOFT_PWM_ +#define _SOFT_PWM_ + +#include "mbed.h" + +class SoftPwm +{ + private: + float period; + float dutyCycle; + Timer timer; + public: + + SoftPwm(float initialPeriod, float initialDutycycle); + + float getPeriod(); + float getDutyCycle(); + + void setPeriod(float newPeriod); + void setDutyCycle(float newDutyCycle); + + bool isOn(); + +}; +#endif \ No newline at end of file