Pierre rouaze
/
fastpwmexample
example for using fast pwm
Example for the use of fast pwm on an stm nucleo F302R8.
main.cpp
- Committer:
- rouaze
- Date:
- 2016-03-31
- Revision:
- 5:41aafda546a3
- Parent:
- 4:f229692e352f
File content as of revision 5:41aafda546a3:
#include "mbed.h" #include "FastPWM.h" //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); //setup the period for 100Khz fastpwm.pulsewidth_ticks( 360);//setup duty cycle to 50% while(1) { } }