as long as switch is pressed LED will light on

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
ramsnpa
Date:
Mon Aug 31 07:25:03 2015 +0000
Commit message:
switch with 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	Mon Aug 31 07:25:03 2015 +0000
@@ -0,0 +1,17 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+DigitalIn swi(PTA1);
+
+int main() {
+    while(1) {
+        if (swi==1)
+        {
+        myled = 0;
+        wait(1);
+       }
+       else
+       myled =1;
+       
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Aug 31 07:25:03 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8ed44a420e5c
\ No newline at end of file