El-POM1001 / Mbed 2 deprecated LAB02_Oppgave1

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
madmonkeyman82
Date:
Fri Oct 09 16:27:16 2015 +0000
Commit message:
Last

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 Oct 09 16:27:16 2015 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+
+BusOut Leds(PA_9,PC_7,PB_6,PA_7,PA_6,PA_5,PB_5,PB_4);
+
+DigitalIn SW7(PB_3);
+DigitalIn SW6(PA_10);
+
+int main() 
+{
+    int teller = 0;
+    
+    Leds = ~teller;
+
+    while (true) 
+    {
+        if (SW7 == 0)
+        {
+         teller = teller + 1;
+         Leds = ~teller;
+         wait_ms(2);
+                  
+         while (SW7 == 0)
+         {
+             wait_ms(1);
+         } // end while debounce
+
+         
+        } // end if
+           
+        if (SW6 == 0){
+            teller=0;
+            Leds = ~teller;
+            
+            
+            } 
+    } // end while "loop"
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Oct 09 16:27:16 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/ba1f97679dad
\ No newline at end of file