Pierre rouaze
/
fastpwmexample
example for using fast pwm
Example for the use of fast pwm on an stm nucleo F302R8.
Diff: main.cpp
- Revision:
- 5:41aafda546a3
- Parent:
- 4:f229692e352f
--- a/main.cpp Thu Mar 31 12:24:57 2016 +0000 +++ b/main.cpp Thu Mar 31 12:35:28 2016 +0000 @@ -1,9 +1,10 @@ #include "mbed.h" #include "FastPWM.h" - FastPWM fastpwm(D11,1); +//fast pwm example for stm nucleo f302r8 + FastPWM fastpwm(D11,1); //steup pwm output on pin d11 with a prescaler of 1 int main() { - fastpwm.period_ticks (720); - fastpwm.pulsewidth_ticks( 350); + fastpwm.period_ticks (720); //setup the period for 100Khz + fastpwm.pulsewidth_ticks( 360);//setup duty cycle to 50% while(1) { } }