Anjani Vasavi Pendela / Mbed 2 deprecated m1

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
AnjaniVasavi
Date:
Mon Jul 20 10:29:26 2015 +0000
Commit message:
sensor program

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Jul 20 10:29:26 2015 +0000
@@ -0,0 +1,56 @@
+#include "mbed.h"
+
+
+DigitalIn a(PTB1);
+DigitalIn b(PTB0);
+DigitalOut c(PTB8);
+DigitalOut myled(LED1);
+ 
+
+int main() 
+{
+    myled=0;
+    int count=0;
+    while(1)
+    {
+     // int count=0;
+     if(a==0)
+      {
+       count++;
+       if(count>=1)
+        {
+         c=1;
+         myled =0;
+        }
+        else
+        {
+         c=0;
+         myled =1;
+        }
+                        
+       }
+        wait(2);
+        
+        if(b==0)
+        {
+         count--;
+         if(count>=1)
+          {
+           c=1;
+           myled =0;
+          }
+          else
+          {
+           c=0;
+           myled =1;
+          }
+         }
+            
+     }
+    }
+        
+    
+    
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Jul 20 10:29:26 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/da0ca467f8b5
\ No newline at end of file