jin young sung / Mbed 2 deprecated Led Clock Download Featured

Dependencies:   mbed

Revision:
7:11a20cba4eae
Parent:
6:276d384f8483
Child:
8:b162bf17271f
--- a/main.cpp	Mon May 18 14:49:08 2015 +0000
+++ b/main.cpp	Mon May 18 15:27:16 2015 +0000
@@ -13,27 +13,40 @@
 BusOut minute();             //Minute hand
 BusOut 
 InterruptIn hall();          //Hall sensor sensing interrupt
+Timer timer;
 
 void hour_hand(void);
 void minute_hand(void);
+void sensor();
 
-void sensor()
-{
-    
-    
-}
+int i=0;
 
 int main() 
 {
     hall.rise(&sensor);      //rising edge operating
+    int a = 0;
     
     while(1)
     {    
         frame = 1;
         hour_hand();
         minute_hand();
+        if (i==10)
+        {
+            timer.start();
+        }
+        if (i==11)
+        {
+            timer.stop();
+            
+            a = timer.read();
+        }
     }
 }
+void sensor()
+{
+     i=i+1;
+}
 
 void hour_hand(void)
 {