SAMI NAQVI
/
TALab3C_PWM
Creates a PWM ouput
Diff: main.cpp
- Revision:
- 0:ef49bba2b9c1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Feb 06 01:56:55 2022 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" +//PWM output channel +PwmOut PWM1(A5); +int main() +{ + PWM1.period_ms(500); + int x; + x=1; + while(1) + { + PWM1.pulsewidth_ms(x); + x=x+1; + wait(.1); + if(x==500) + { + x=1; + } + } +} \ No newline at end of file