Basic example showing the Signals API

Dependencies:   mbed-rtos mbed

mbed 2 and mbed OS 5

This is an mbed 2 example. mbed OS 5 has intergrated the mbed library with mbed-rtos. For an mbed-os example, please see:

Import programrtos_signals

signals example

Revision:
6:8359b29626dc
Parent:
5:476186ff82cf
--- a/main.cpp	Fri Jan 13 19:50:30 2017 +0000
+++ b/main.cpp	Wed Feb 15 13:51:51 2017 -0600
@@ -1,6 +1,6 @@
 #include "mbed.h"
+#include "rtos.h"
 
-Thread thread;
 DigitalOut led(LED1);
 
 void led_thread() {
@@ -12,10 +12,12 @@
 }
 
 int main (void) {
+    Thread thread;
+
     thread.start(callback(led_thread));
 
     while (true) {
-        wait(1);
+        Thread::wait(1000);
         thread.signal_set(0x1);
     }
 }