Pierre rouaze
/
fastpwmexample
example for using fast pwm
Example for the use of fast pwm on an stm nucleo F302R8.
Revision 5:41aafda546a3, committed 2016-03-31
- Comitter:
- rouaze
- Date:
- Thu Mar 31 12:35:28 2016 +0000
- Parent:
- 4:f229692e352f
- Commit message:
- added comments and the board it was writen for;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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) { } }