Enis Ataoglu / Mbed 2 deprecated PWM

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 PwmOut mypwm1(PB_3);
00004 PwmOut mypwm2(PB_4);
00005 PwmOut mypwm3(PB_5);
00006  
00007 DigitalOut myled(LED1);
00008  
00009 int main() {
00010     
00011     mypwm1.period_ms(10);
00012     mypwm1.pulsewidth_ms(5);
00013  
00014     mypwm2.period_ms(20);
00015     mypwm2.pulsewidth_ms(5);
00016  
00017     mypwm3.period_ms(20);
00018     mypwm3.pulsewidth_ms(5);
00019   
00020     
00021     while(1) {
00022         myled = !myled;
00023         wait(1);
00024     }
00025 }