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.
Dependencies: mbed
main.cpp
00001 #include "mbed.h" 00002 00003 PwmOut mypwm(PWM_OUT); 00004 PwmOut myled(LED1); 00005 00006 00007 int main() 00008 { 00009 00010 mypwm.period_us(2); 00011 mypwm.pulsewidth_us(1); 00012 00013 printf("pwm set to %.2f %%\n", mypwm.read() * 100); 00014 00015 myled.period(1.0f); 00016 00017 while(1) { 00018 myled = myled + 0.01f; 00019 wait(0.2); 00020 if(myled == 1.0f) { 00021 myled = 0; 00022 } 00023 } 00024 }
Generated on Tue Aug 23 2022 00:10:08 by
1.7.2