Testing Pushbutton states

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
tpavle13
Date:
Fri May 08 17:39:15 2015 +0000
Commit message:
Vje?ba 5, pali LED nakon 3 pritiska na tipku

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	Fri May 08 17:39:15 2015 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+DigitalIn sw1(p5);
+DigitalOut out1(p10);
+int i;
+int main() {
+    
+      sw1.mode(PullUp);
+      out1=0;
+      while(1){
+        if(sw1==0){ 
+                  
+            if(sw1==1){                
+                i=i++;
+                
+                    if(i==3){
+                        out1=1;           
+                }
+            }
+        }
+    }
+ }           
+        
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri May 08 17:39:15 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8ab26030e058
\ No newline at end of file