Template project for University of York ELE00032C Lab 8

Dependencies:   UoY-serial

Files at this revision

API Documentation at this revision

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
--- 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
+    
+}