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:462d7a29641d, 2012-04-25 (annotated)
- Committer:
- gadgetcafe08
- Date:
- Wed Apr 25 09:15:07 2012 +0000
- Revision:
- 0:462d7a29641d
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| gadgetcafe08 | 0:462d7a29641d | 1 | #include "mbed.h" |
| gadgetcafe08 | 0:462d7a29641d | 2 | |
| gadgetcafe08 | 0:462d7a29641d | 3 | DigitalOut myled(LED1); |
| gadgetcafe08 | 0:462d7a29641d | 4 | PwmOut myled2(LED2); |
| gadgetcafe08 | 0:462d7a29641d | 5 | DigitalOut myled4(LED4); |
| gadgetcafe08 | 0:462d7a29641d | 6 | DigitalOut myled3(LED3); |
| gadgetcafe08 | 0:462d7a29641d | 7 | |
| gadgetcafe08 | 0:462d7a29641d | 8 | int main() { |
| gadgetcafe08 | 0:462d7a29641d | 9 | while(1) { |
| gadgetcafe08 | 0:462d7a29641d | 10 | myled4 = (myled4+1)%2; |
| gadgetcafe08 | 0:462d7a29641d | 11 | myled3 = (myled4+1)%2; |
| gadgetcafe08 | 0:462d7a29641d | 12 | myled = 1; |
| gadgetcafe08 | 0:462d7a29641d | 13 | wait(0.2); |
| gadgetcafe08 | 0:462d7a29641d | 14 | myled = 0; |
| gadgetcafe08 | 0:462d7a29641d | 15 | wait(0.2); |
| gadgetcafe08 | 0:462d7a29641d | 16 | for(float p = 0.0f; p < 1.0f; p += 0.1f) { |
| gadgetcafe08 | 0:462d7a29641d | 17 | myled2 = p; |
| gadgetcafe08 | 0:462d7a29641d | 18 | wait(0.1); |
| gadgetcafe08 | 0:462d7a29641d | 19 | } |
| gadgetcafe08 | 0:462d7a29641d | 20 | } |
| gadgetcafe08 | 0:462d7a29641d | 21 | } |