TINF_MyPwm
MyPwm.cpp
- Committer:
- martwerl
- Date:
- 2018-06-22
- Revision:
- 0:728d17af5d23
File content as of revision 0:728d17af5d23:
#include "mbed.h" #include "MyPwm.h" void MyPwm::dimUp(void) { while(_pin != 1) { _pin = _pin + 0.1; printStatus(); wait_ms(500); } } void MyPwm::dimDown(void) { while (_pin != 0) { _pin = _pin - 0.1; printStatus(); wait_ms(500); } } void MyPwm::printStatus(void) { printf("Led-Wert: %1.1f \n", (float)_pin); }