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:1168529b2d03, 2014-04-07 (annotated)
- Committer:
- Stoni_90
- Date:
- Mon Apr 07 13:04:28 2014 +0000
- Revision:
- 0:1168529b2d03
- Child:
- 1:2ff187087b49
added LED2
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Stoni_90 | 0:1168529b2d03 | 1 | #include "mbed.h" |
| Stoni_90 | 0:1168529b2d03 | 2 | |
| Stoni_90 | 0:1168529b2d03 | 3 | DigitalOut myled(LED1); |
| Stoni_90 | 0:1168529b2d03 | 4 | DigitalOut myled2(LED2); |
| Stoni_90 | 0:1168529b2d03 | 5 | |
| Stoni_90 | 0:1168529b2d03 | 6 | int main() { |
| Stoni_90 | 0:1168529b2d03 | 7 | while(1) { |
| Stoni_90 | 0:1168529b2d03 | 8 | myled = 1; // LED is ON |
| Stoni_90 | 0:1168529b2d03 | 9 | myled2 = 0; // LED2 is OFF |
| Stoni_90 | 0:1168529b2d03 | 10 | wait(0.2); // 200 ms |
| Stoni_90 | 0:1168529b2d03 | 11 | myled = 0; // LED is OFF |
| Stoni_90 | 0:1168529b2d03 | 12 | myled2 = 1; // LED2 is ON |
| Stoni_90 | 0:1168529b2d03 | 13 | wait(1.0); // 1 sec |
| Stoni_90 | 0:1168529b2d03 | 14 | } |
| Stoni_90 | 0:1168529b2d03 | 15 | } |