Scheduller Demo

Dependencies:   Scheduler mbed

Fork of scheduler-demo-cq-lpc11u35 by mi mi

Revision:
3:d098b01b9dcb
Parent:
2:6b3e85379edd
--- a/main.cpp	Fri Mar 07 14:57:13 2014 +0000
+++ b/main.cpp	Sun May 18 03:53:18 2014 +0000
@@ -3,21 +3,24 @@
 #include "Scheduler.h"
 #include "led_tsk.h"
 
-Serial pc(UART_TX, UART_RX);
+DigitalIn s1(P0_1);
+DigitalOut led2(P0_21);
  
 int main()
 {
-    int i=0;
-    pc.baud(115200);
     scheduler_startLoop( led1_task );
-    scheduler_startLoop( led2_task );
-    
+     
     while(1) {
-        pc.printf("\nHello World ! / mbed LPC11U35 %4d",i++);
-        taskWait(1000);
+        if(s1 == 0){            //ISP SW ON?
+            led2 = !led2;       //Green LED ON/OFF
+            taskWait(10);       //Chattering wait 10ms
+            while(s1 == 0){     //ISP SW OFF?
+                taskWait(10);   //Chattering wait 10ms
+            }
+        }
+        taskWait(20);           //Next check wait
     }
-
-}
+ }
 
 
         
\ No newline at end of file