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:1b56cf88e38c, 2016-07-20 (annotated)
- Committer:
- gitakichi
- Date:
- Wed Jul 20 13:08:05 2016 +0000
- Revision:
- 0:1b56cf88e38c
- Child:
- 1:1b9ca25019a6
?????
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| gitakichi | 0:1b56cf88e38c | 1 | #include "mbed.h" |
| gitakichi | 0:1b56cf88e38c | 2 | |
| gitakichi | 0:1b56cf88e38c | 3 | PwmOut mypwm(PC_8); |
| gitakichi | 0:1b56cf88e38c | 4 | |
| gitakichi | 0:1b56cf88e38c | 5 | DigitalOut myled(LED1); |
| gitakichi | 0:1b56cf88e38c | 6 | |
| gitakichi | 0:1b56cf88e38c | 7 | int main() { |
| gitakichi | 0:1b56cf88e38c | 8 | |
| gitakichi | 0:1b56cf88e38c | 9 | mypwm.period_us(100); |
| gitakichi | 0:1b56cf88e38c | 10 | mypwm.pulsewidth_us(1); |
| gitakichi | 0:1b56cf88e38c | 11 | |
| gitakichi | 0:1b56cf88e38c | 12 | printf("pwm set to %.2f %%\n", mypwm.read() * 100); |
| gitakichi | 0:1b56cf88e38c | 13 | |
| gitakichi | 0:1b56cf88e38c | 14 | while(1) { |
| gitakichi | 0:1b56cf88e38c | 15 | myled = !myled; |
| gitakichi | 0:1b56cf88e38c | 16 | wait(1); |
| gitakichi | 0:1b56cf88e38c | 17 | } |
| gitakichi | 0:1b56cf88e38c | 18 | } |