Jack Occleshaw
/
w3-PWM2
w3PWM2
Diff: main.cpp
- Revision:
- 0:78a79836bc56
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Jan 12 15:44:40 2017 +0000 @@ -0,0 +1,7 @@ +#include "mbed.h" +PwmOut PWM1(PTC10); //create a PWM output called PWM1 on pin 21 + +int main() { + PWM1.period_ms(10); // set PWM period to 10 ms + PWM1.pulsewidth_ms(5); // set pulse width to 5 ms +}