SP1 vers 3
Dependents: SoufflerieSP1-vers2
Diff: pwm.cpp
- Revision:
- 0:63a2685bf4f0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pwm.cpp Tue Jun 08 10:37:05 2021 +0000 @@ -0,0 +1,15 @@ +#include "mbed.h" +#include "pwm.h" +PwmOut PwmMot(PA_15); + +void InitPwmMot(void) +{ + PwmMot.period_ms(20); + PwmMot.pulsewidth_us(875); +} + +void SetPwmMot(unsigned char Pourcent) +{ + int th = 875 + (float)Pourcent * 11.25; + PwmMot.pulsewidth_us(th); +} \ No newline at end of file