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:cc00340e998c, 2016-05-04 (annotated)
- Committer:
- nexseed
- Date:
- Wed May 04 00:21:14 2016 +0000
- Revision:
- 0:cc00340e998c
add led2
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| nexseed | 0:cc00340e998c | 1 | #include "mbed.h" |
| nexseed | 0:cc00340e998c | 2 | |
| nexseed | 0:cc00340e998c | 3 | DigitalOut myled1(LED1); |
| nexseed | 0:cc00340e998c | 4 | DigitalOut myled2(LED2); |
| nexseed | 0:cc00340e998c | 5 | |
| nexseed | 0:cc00340e998c | 6 | int main() { |
| nexseed | 0:cc00340e998c | 7 | while(1) { |
| nexseed | 0:cc00340e998c | 8 | myled1 = 1; // LED is ON |
| nexseed | 0:cc00340e998c | 9 | myled2 = 0; |
| nexseed | 0:cc00340e998c | 10 | wait(0.2); // 200 ms |
| nexseed | 0:cc00340e998c | 11 | myled1 = 0; |
| nexseed | 0:cc00340e998c | 12 | myled2 = 1; // LED is ON |
| nexseed | 0:cc00340e998c | 13 | myled2 = 0; |
| nexseed | 0:cc00340e998c | 14 | wait(0.2); // 200 ms |
| nexseed | 0:cc00340e998c | 15 | } |
| nexseed | 0:cc00340e998c | 16 | } |