ichiro shirasaka / Mbed 2 deprecated scheduler-demo-cq-lpc11u35

Dependencies:   Scheduler mbed

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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 
00002 #include "mbed.h"
00003 #include "Scheduler.h"
00004 #include "led_tsk.h"
00005 
00006 DigitalIn s1(P0_1);
00007 DigitalOut led2(P0_21);
00008  
00009 int main()
00010 {
00011     scheduler_startLoop( led1_task );
00012      
00013     while(1) {
00014         if(s1 == 0){            //ISP SW ON?
00015             led2 = !led2;       //Green LED ON/OFF
00016             taskWait(10);       //Chattering wait 10ms
00017             while(s1 == 0){     //ISP SW OFF?
00018                 taskWait(10);   //Chattering wait 10ms
00019             }
00020         }
00021         taskWait(20);           //Next check wait
00022     }
00023  }
00024 
00025 
00026