kol

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
jon07
Date:
Thu Nov 09 13:47:06 2017 +0000
Commit message:
ll

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 5827fd72218f main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 09 13:47:06 2017 +0000
@@ -0,0 +1,30 @@
+#include "mbed.h"
+#include "rtos.h"
+ 
+DigitalIn myswitch1(A5);
+DigitalOut myled1(D4);
+int estadoled1=1;
+ 
+void thread_led1(void const *argument)
+{
+    while (1) {
+        Thread::signal_wait(0x1);
+        myled1 = !myled1;
+ 
+    }
+}
+ 
+int main()
+{
+    Thread thread(thread_led1, NULL, osPriorityNormal, DEFAULT_STACK_SIZE);
+ 
+    while (true) {
+        if (estadoled1&&(!myswitch1)) {
+            thread.signal_set(0x1);
+            //thread.start(thread_led1);
+ 
+        }
+        estadoled1=myswitch1;
+        Thread::wait(200);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 5827fd72218f mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 09 13:47:06 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/fb8e0ae1cceb
\ No newline at end of file