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@2:f0cd1961cbe3, 2018-11-08 (annotated)
- Committer:
- CharlesBl
- Date:
- Thu Nov 08 10:57:14 2018 +0000
- Revision:
- 2:f0cd1961cbe3
- Parent:
- 1:b667efac1cae
- Child:
- 3:5c32522fbe3f
test;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
CharlesBl | 0:d0a183ba50d5 | 1 | #include "mbed.h" |
CharlesBl | 0:d0a183ba50d5 | 2 | |
CharlesBl | 0:d0a183ba50d5 | 3 | PwmOut mypwm(PWM_OUT); |
CharlesBl | 0:d0a183ba50d5 | 4 | |
CharlesBl | 0:d0a183ba50d5 | 5 | DigitalOut myled(LED1); |
CharlesBl | 1:b667efac1cae | 6 | //test |
CharlesBl | 2:f0cd1961cbe3 | 7 | //balfjakc |
CharlesBl | 0:d0a183ba50d5 | 8 | |
CharlesBl | 0:d0a183ba50d5 | 9 | int main() { |
CharlesBl | 0:d0a183ba50d5 | 10 | |
CharlesBl | 0:d0a183ba50d5 | 11 | mypwm.period_ms(10); |
CharlesBl | 0:d0a183ba50d5 | 12 | mypwm.pulsewidth_ms(1); |
CharlesBl | 0:d0a183ba50d5 | 13 | |
CharlesBl | 0:d0a183ba50d5 | 14 | printf("pwm set to %.2f %%\n", mypwm.read() * 100); |
CharlesBl | 0:d0a183ba50d5 | 15 | |
CharlesBl | 0:d0a183ba50d5 | 16 | while(1) { |
CharlesBl | 0:d0a183ba50d5 | 17 | myled = !myled; |
CharlesBl | 0:d0a183ba50d5 | 18 | wait(1); |
CharlesBl | 0:d0a183ba50d5 | 19 | } |
CharlesBl | 0:d0a183ba50d5 | 20 | } |