Simple PWM for DC motor on A4 and A5

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002  
00003 //PWM output channel
00004 PwmOut PWM1(A4);
00005 PwmOut PWM2(A5);
00006  
00007 int main()
00008 {
00009     PWM1.period_ms(500);
00010     PWM2.period_ms(500);
00011     PWM1.pulsewidth_ms(500); 
00012     PWM2.pulsewidth_ms(500);   
00013 }