satheeshvarma sj / Mbed 2 deprecated switch-cnt

Dependencies:   mbed

Fork of switchcount by satheeshvarma sj

main.cpp

Committer:
sjsvarma
Date:
2013-06-06
Revision:
0:af296e7fa008

File content as of revision 0:af296e7fa008:

#include "mbed.h"

DigitalOut myled1(LED1);
DigitalIn myswitch(p20);
int i=1;
int main() {
    while(1)
     {
     if(myswitch==1)
     {
     wait(0.5);
     if(i==10)
     {
     myled1 = 1;
     wait(3);
      i=0;
     myled1 = 0;
     }
      i++;   
    }
    }
}