complete files of the lab

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Ajay_Marampally
Date:
Sun Oct 28 16:57:09 2018 +0000
Commit message:
the complete document of the mbed lab ;

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 3a7830aaaed9 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Oct 28 16:57:09 2018 +0000
@@ -0,0 +1,50 @@
+#include "mbed.h"
+#include "rtos.h"
+DigitalOut led1(LED1);
+DigitalOut led2(LED1);
+DigitalOut led3(LED1);
+DigitalOut led4(LED1);
+Serial pc(USBTX, USBRX); 
+
+Thread *(test);
+
+void led2_thread(void const *args)
+{
+    while(1){
+        led2=!led2;
+        Thread::wait(1000);
+        }
+}
+void led4_thread(void const *args)
+{
+    while(1){
+        led4=!led4;
+        Thread::wait(500);
+        }
+}
+
+int main() {
+    Thread thread(led2_thread);
+    test=&thread;
+    char ch;
+    test->set_priority(osPriorityHigh);
+    ch=test->get_priority();
+    pc.printf("%c\n\r",ch);
+    Thread thread1(led4_thread);
+    test=&thread;
+    char ch1;
+    test->set_priority(osPriorityLow);
+    ch=test->get_priority();
+    pc.printf("%c\n\r",ch1);
+    
+    while(1)
+    {
+        led1=!led1;
+        led3=!led3;
+        Thread::wait(500);
+        
+    }
+}
+
+    
+       
\ No newline at end of file
diff -r 000000000000 -r 3a7830aaaed9 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Oct 28 16:57:09 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/e95d10626187
\ No newline at end of file