Niranjan Ravi / Mbed 2 deprecated frdm_2018

Dependencies:   mbed DigitDisplay LED_Bar

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 //PWM output channel
00003 PwmOut PWM1(A5);
00004 int main()
00005 {
00006 PWM1.period_ms(500);
00007 int x;
00008 x=1;
00009 while(1)
00010 {
00011 PWM1.pulsewidth_ms(x);
00012 x=x+1;
00013 wait(2);
00014 if(x==500)
00015 {
00016 x=1;
00017 }
00018 }
00019 }