oppg2

Dependencies:   mbed

Fork of LAB07_Oppgave2 by EL-POM1001

Revision:
0:78adfca8ca69
Child:
1:2e42c8846b90
diff -r 000000000000 -r 78adfca8ca69 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Sep 20 14:30:57 2015 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+
+
+InterruptIn TachInput(PB_3);  
+
+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;
+}
+
+int main()
+{    
+    TachInput.fall(&TachSensed);  
+                            
+    while (true) 
+    {    teller=0;
+         TachInput.enable_irq();                             
+         wait_ms(1000);
+         TachInput.disable_irq();
+         
+         Leds=~  ((1<< teller) -1);          
+    }
+}
\ No newline at end of file