satheeshvarma sj / Mbed 2 deprecated switch-cnt

Dependencies:   mbed

Fork of switchcount by satheeshvarma sj

Revision:
0:af296e7fa008
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Jun 06 09:32:36 2013 +0000
@@ -0,0 +1,22 @@
+#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++;   
+    }
+    }
+}
\ No newline at end of file