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@8:c1e1db61aee7, 2017-01-12 (annotated)
- Committer:
- mab5449
- Date:
- Thu Jan 12 22:58:45 2017 +0000
- Revision:
- 8:c1e1db61aee7
- Parent:
- 7:8d9919175929
- Child:
- 9:dd58814e2dcf
Updating to mbed OS
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
emilmont | 1:491820ee784d | 1 | #include "mbed.h" |
emilmont | 1:491820ee784d | 2 | |
emilmont | 1:491820ee784d | 3 | DigitalOut led1(LED1); |
emilmont | 1:491820ee784d | 4 | DigitalOut led2(LED2); |
geky | 7:8d9919175929 | 5 | Thread thread; |
emilmont | 1:491820ee784d | 6 | |
geky | 7:8d9919175929 | 7 | void led2_thread() { |
emilmont | 1:491820ee784d | 8 | while (true) { |
emilmont | 1:491820ee784d | 9 | led2 = !led2; |
emilmont | 1:491820ee784d | 10 | Thread::wait(1000); |
emilmont | 1:491820ee784d | 11 | } |
emilmont | 1:491820ee784d | 12 | } |
emilmont | 1:491820ee784d | 13 | |
emilmont | 1:491820ee784d | 14 | int main() { |
geky | 7:8d9919175929 | 15 | thread.start(led2_thread); |
emilmont | 1:491820ee784d | 16 | |
emilmont | 1:491820ee784d | 17 | while (true) { |
emilmont | 1:491820ee784d | 18 | led1 = !led1; |
emilmont | 1:491820ee784d | 19 | Thread::wait(500); |
emilmont | 1:491820ee784d | 20 | } |
emilmont | 1:491820ee784d | 21 | } |