CHECK SW AND LED ON

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
rajivwagle
Date:
Thu Mar 08 12:07:12 2018 +0000
Commit message:
SW-LED

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	Thu Mar 08 12:07:12 2018 +0000
@@ -0,0 +1,41 @@
+#include "mbed.h"
+
+DigitalOut myled1(p23);
+ 
+DigitalOut myled2(p24);
+
+DigitalIn  switchinput1(p18);
+
+DigitalIn  switchinput2(p14);
+
+int main() {
+    
+    while(1){
+
+        if(switchinput1==1)
+        {
+
+        myled1 = 0;
+        wait(0.1); 
+        }
+        else
+        {        
+        myled1 = 1;
+        wait(0.1);
+        }
+        if(switchinput2==1)
+        {
+
+         
+        myled2 = 0;
+        wait(0.1);
+        }
+        else
+        {        
+     
+         
+        myled2 = 1;
+        wait(0.1);
+        }
+        }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Mar 08 12:07:12 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/7130f322cb7e
\ No newline at end of file