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@0:ac0af9ce85ae, 2014-08-20 (annotated)
- Committer:
- CSCLOG
- Date:
- Wed Aug 20 18:48:42 2014 +0000
- Revision:
- 0:ac0af9ce85ae
Test
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| CSCLOG | 0:ac0af9ce85ae | 1 | #include "mbed.h" |
| CSCLOG | 0:ac0af9ce85ae | 2 | |
| CSCLOG | 0:ac0af9ce85ae | 3 | PwmOut mypwm(PWM_OUT); |
| CSCLOG | 0:ac0af9ce85ae | 4 | |
| CSCLOG | 0:ac0af9ce85ae | 5 | DigitalOut myled(LED1); |
| CSCLOG | 0:ac0af9ce85ae | 6 | |
| CSCLOG | 0:ac0af9ce85ae | 7 | int main() { |
| CSCLOG | 0:ac0af9ce85ae | 8 | |
| CSCLOG | 0:ac0af9ce85ae | 9 | mypwm.period_ms(10); |
| CSCLOG | 0:ac0af9ce85ae | 10 | mypwm.pulsewidth_ms(1); |
| CSCLOG | 0:ac0af9ce85ae | 11 | |
| CSCLOG | 0:ac0af9ce85ae | 12 | printf("pwm set to %.2f %%\n", mypwm.read() * 100); |
| CSCLOG | 0:ac0af9ce85ae | 13 | |
| CSCLOG | 0:ac0af9ce85ae | 14 | while(1) { |
| CSCLOG | 0:ac0af9ce85ae | 15 | myled = !myled; |
| CSCLOG | 0:ac0af9ce85ae | 16 | wait(1); |
| CSCLOG | 0:ac0af9ce85ae | 17 | } |
| CSCLOG | 0:ac0af9ce85ae | 18 | } |