Simple PWM for DC motor on A4 and A5
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:60a2d34f6420
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Mar 09 11:06:13 2017 +0000 @@ -0,0 +1,13 @@ +#include "mbed.h" + +//PWM output channel +PwmOut PWM1(A4); +PwmOut PWM2(A5); + +int main() +{ + PWM1.period_ms(500); + PWM2.period_ms(500); + PWM1.pulsewidth_ms(500); + PWM2.pulsewidth_ms(500); +} \ No newline at end of file