![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Template project for University of York ELE00032C Lab 8
Revision 2:ebee08edbab9, committed 2021-02-10
- Comitter:
- ajp109
- Date:
- Wed Feb 10 16:06:39 2021 +0000
- Parent:
- 1:acb591685a28
- Commit message:
- Initial commit (lab8-threads)
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r acb591685a28 -r ebee08edbab9 main.cpp --- a/main.cpp Thu Feb 04 17:12:01 2021 +0000 +++ b/main.cpp Wed Feb 10 16:06:39 2021 +0000 @@ -3,12 +3,18 @@ DigitalOut green(D2); DigitalOut red(D3); -int main() -{ - while (true) { - green = true; - thread_sleep_for(500); - green = false; - thread_sleep_for(2500); - } +Thread redThread; + +void redThreadFn() { + + // Flash the red LED here + } + +int main() { + + redThread.start(redThreadFn); + + // Flash the green LED here + +}