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.
Fork of Nucleo_blink_led by
Diff: main.cpp
- Revision:
- 4:4539efb716ad
- Parent:
- 3:fdab3990f086
- Child:
- 5:602760db0b2d
--- a/main.cpp Mon Apr 27 19:40:07 2015 +0000 +++ b/main.cpp Tue May 05 02:49:04 2015 +0000 @@ -2,6 +2,7 @@ InterruptIn mybutton(USER_BUTTON); DigitalOut myled(LED1); +PwmOut mypwm(PWM_OUT); int i=250; @@ -9,31 +10,47 @@ { switch (i) { case 250: + { i=500; + mypwm.period_ms(10); + mypwm.pulsewidth_ms(2); + } break; case 500: i=750; + mypwm.period_ms(10); + mypwm.pulsewidth_ms(3); break; case 750: i=1000; + mypwm.period_ms(10); + mypwm.pulsewidth_ms(4); break; case 1000: i=1250; + mypwm.period_ms(10); + mypwm.pulsewidth_ms(5); break; case 1250: i=1500; + mypwm.period_ms(10); + mypwm.pulsewidth_ms(6); break; case 1500: i=250; + mypwm.period_ms(10); + mypwm.pulsewidth_ms(1); break; default: i=250; + mypwm.period_ms(10); + mypwm.pulsewidth_ms(1); break; } }