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:aacbb0060c5c, 2018-01-07 (annotated)
- Committer:
- workingyifei
- Date:
- Sun Jan 07 02:42:41 2018 +0000
- Revision:
- 0:aacbb0060c5c
- Child:
- 1:f0543338c25a
blinky LEDs
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| workingyifei | 0:aacbb0060c5c | 1 | #include "mbed.h" |
| workingyifei | 0:aacbb0060c5c | 2 | |
| workingyifei | 0:aacbb0060c5c | 3 | DigitalOut led2(LED2); |
| workingyifei | 0:aacbb0060c5c | 4 | DigitalOut led1(LED1); |
| workingyifei | 0:aacbb0060c5c | 5 | |
| workingyifei | 0:aacbb0060c5c | 6 | // main() runs in its own thread in the OS |
| workingyifei | 0:aacbb0060c5c | 7 | int main() { |
| workingyifei | 0:aacbb0060c5c | 8 | while (true) { |
| workingyifei | 0:aacbb0060c5c | 9 | led2 = !led2; |
| workingyifei | 0:aacbb0060c5c | 10 | wait(0.5); |
| workingyifei | 0:aacbb0060c5c | 11 | led1 = !led1; |
| workingyifei | 0:aacbb0060c5c | 12 | } |
| workingyifei | 0:aacbb0060c5c | 13 | } |
| workingyifei | 0:aacbb0060c5c | 14 |