Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 00003 00004 00005 00006 PwmOut mypwm(PA_4); 00007 DigitalInOut din(PA_4); 00008 00009 //DigitalIn button(PA_0); 00010 //DigitalOut myled(PC_9); 00011 00012 int main() { 00013 mypwm.period(0.01); 00014 float pulsewidth = 0; 00015 while(1) { 00016 if (pulsewidth>=1.0) pulsewidth=0; 00017 mypwm.write(pulsewidth+=0.1); 00018 // myled = !myled; 00019 wait(1); 00020 } 00021 }
Generated on Mon Jul 25 2022 13:10:54 by
1.7.2