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@1:f0543338c25a, 2018-01-07 (annotated)
- Committer:
- workingyifei
- Date:
- Sun Jan 07 05:07:22 2018 +0000
- Revision:
- 1:f0543338c25a
- Parent:
- 0:aacbb0060c5c
three LEDS flash one at at time;
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 | 1:f0543338c25a | 3 | DigitalOut led3(LED3); |
workingyifei | 0:aacbb0060c5c | 4 | DigitalOut led2(LED2); |
workingyifei | 0:aacbb0060c5c | 5 | DigitalOut led1(LED1); |
workingyifei | 0:aacbb0060c5c | 6 | |
workingyifei | 0:aacbb0060c5c | 7 | // main() runs in its own thread in the OS |
workingyifei | 0:aacbb0060c5c | 8 | int main() { |
workingyifei | 0:aacbb0060c5c | 9 | while (true) { |
workingyifei | 1:f0543338c25a | 10 | led1 = !led1; |
workingyifei | 1:f0543338c25a | 11 | wait(0.5); |
workingyifei | 0:aacbb0060c5c | 12 | led2 = !led2; |
workingyifei | 0:aacbb0060c5c | 13 | wait(0.5); |
workingyifei | 1:f0543338c25a | 14 | led3 = !led3; |
workingyifei | 0:aacbb0060c5c | 15 | } |
workingyifei | 0:aacbb0060c5c | 16 | } |
workingyifei | 0:aacbb0060c5c | 17 |