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.
Revision 0:f3c23f8ad677, committed 2018-06-21
- Comitter:
- mexx
- Date:
- Thu Jun 21 07:03:40 2018 +0000
- Commit message:
- PWm Reiner
Changed in this revision
Pwm.cpp | Show annotated file Show diff for this revision Revisions of this file |
Pwm.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r f3c23f8ad677 Pwm.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Pwm.cpp Thu Jun 21 07:03:40 2018 +0000 @@ -0,0 +1,18 @@ +#include "mbed.h" +#include "Pwm.h" + + void MyPwm:: dimUp(void) + { + if (_pin != 1) + _pin = _pin + 0.1; + } + void MyPwm:: dimDown(void) + { + if (_pin != 0) + _pin = _pin - 0.1; + + } + void MyPwm:: printStatus(void) + { + printf("Status der Led: %1.1f \n", (float)_pin); + } \ No newline at end of file
diff -r 000000000000 -r f3c23f8ad677 Pwm.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Pwm.h Thu Jun 21 07:03:40 2018 +0000 @@ -0,0 +1,22 @@ +#include "mbed.h" +#ifndef Pwm_H +#define Pwm_H + +class MyPwm +{ + private: + PwmOut _pin; + public: + MyPwm(PinName pin): _pin(pin) + { + _pin = 0; + } + + void dimUp(void); + void dimDown(void); + void printStatus(void); + +}; + + +#endif \ No newline at end of file