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.
Fork of rtos_basic by
main.cpp@11:0309bef74ba8, 2017-02-15 (annotated)
- Committer:
- mbed_official
- Date:
- Wed Feb 15 14:04:02 2017 -0600
- Revision:
- 11:0309bef74ba8
- Parent:
- 10:dc33cd3f4eb9
- Child:
- 12:9ec78b07c688
Revert update to mbed-os.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
emilmont | 1:491820ee784d | 1 | #include "mbed.h" |
mbed_official | 11:0309bef74ba8 | 2 | #include "rtos.h" |
emilmont | 1:491820ee784d | 3 | |
emilmont | 1:491820ee784d | 4 | DigitalOut led1(LED1); |
emilmont | 1:491820ee784d | 5 | DigitalOut led2(LED2); |
geky | 7:8d9919175929 | 6 | Thread thread; |
emilmont | 1:491820ee784d | 7 | |
geky | 7:8d9919175929 | 8 | void led2_thread() { |
emilmont | 1:491820ee784d | 9 | while (true) { |
emilmont | 1:491820ee784d | 10 | led2 = !led2; |
mbed_official | 11:0309bef74ba8 | 11 | Thread::wait(1000); |
emilmont | 1:491820ee784d | 12 | } |
emilmont | 1:491820ee784d | 13 | } |
emilmont | 1:491820ee784d | 14 | |
emilmont | 1:491820ee784d | 15 | int main() { |
geky | 7:8d9919175929 | 16 | thread.start(led2_thread); |
emilmont | 1:491820ee784d | 17 | |
emilmont | 1:491820ee784d | 18 | while (true) { |
emilmont | 1:491820ee784d | 19 | led1 = !led1; |
mbed_official | 11:0309bef74ba8 | 20 | Thread::wait(500); |
emilmont | 1:491820ee784d | 21 | } |
emilmont | 1:491820ee784d | 22 | } |