Blinky disco lights for the K64F implemented with RTOS threads.

Dependencies:   mbed-rtos mbed

Fork of K64F-RTOS-Disco-LEDs by Mark Bundgus

Revision:
0:f1e76cd00a6e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Aug 07 03:03:03 2014 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+#include "rtos.h"
+
+void blinkLED1(void const *args) {
+    DigitalOut led1(LED1);
+    while(true){
+        led1 = !led1;
+        Thread::wait(300);
+    }
+}
+
+void blinkLED2(void const *args) {
+    DigitalOut led2(LED2);
+    while(true){
+        led2 = !led2;
+        Thread::wait(500);
+    }
+}
+
+void blinkLED3(void const *args) {
+    DigitalOut led3(LED3);
+    while(true){
+        led3 = !led3;
+        Thread::wait(800);
+    }
+}
+int main() {
+
+    Thread thread1(blinkLED1);
+    Thread thread2(blinkLED2);
+    Thread thread3(blinkLED3);
+
+    while (true) {
+        Thread::wait(250);
+    }
+
+}