s

Dependencies:   mbed

Fork of LAB07_Oppgave2 by EL-POM1001

Revision:
1:2e42c8846b90
Parent:
0:78adfca8ca69
Child:
2:a27126b6128e
--- a/main.cpp	Sun Sep 20 14:30:57 2015 +0000
+++ b/main.cpp	Wed Oct 14 18:28:27 2015 +0000
@@ -1,25 +1,19 @@
 #include "mbed.h"
 
+InterruptIn knapp(PB_3);
+
+BusOut leds(PA_9,PC_7,PB_6,PA_7,PA_6,PA_5,PB_5,PB_4);
+static int teller=0;
+
 
-InterruptIn TachInput(PB_3);  
+void knappTrykket(){   
 
-BusOut Leds(PA_9,PC_7,PB_6,PA_7,PA_6,PA_5,PB_5,PB_4);
-static int teller=0;
-
-void TachSensed()
-{ teller=teller+1;
+    teller=teller+1;
+    leds=~teller;    
 }
 
-int main()
-{    
-    TachInput.fall(&TachSensed);  
-                            
-    while (true) 
-    {    teller=0;
-         TachInput.enable_irq();                             
-         wait_ms(1000);
-         TachInput.disable_irq();
-         
-         Leds=~  ((1<< teller) -1);          
-    }
+int main(){   
+    knapp.fall(&knappTrykket);
+    leds=~0;
+    while (true) { wait(1); }
 }
\ No newline at end of file