Testing thread in mbed.

Dependencies:   mbed-rtos mbed

Revision:
0:adb256c0dfa9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Dec 03 07:25:30 2016 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+#include "rtos.h"
+ 
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+ 
+void led2_thread(void const *args) {
+    int i=0;
+    while (i<4) {
+        led2 = !led2;
+        Thread::wait(1000);
+        i++;
+    }
+}
+ 
+int main() {
+    led1 = 1;
+    led2 = 1;
+    uint8_t data[3] = {0x47, 0x32, 0xA7};
+    Thread thread(led2_thread);
+    
+    while (true) {
+        led1 = !led1;
+        Thread::wait(500);
+    }
+}