A Ton (Timer On) is used to provide an \'on delay\' system so as to avoid using wait()

Dependents:   NEWlcd_menu_v2 Garage_Control

Revision:
2:aa908ad1559a
Parent:
1:55c67a056031
Child:
3:123a1b30970a
--- a/Ton.h	Fri Mar 04 12:12:33 2011 +0000
+++ b/Ton.h	Fri Mar 04 13:43:51 2011 +0000
@@ -88,6 +88,20 @@
         }
     }
     
+    /** isRunning
+     * Is the timer active?
+     * @return true if active, false otherwise.
+     */
+    bool isRunning(void) {
+        switch (_mode) {
+        case InputResets:
+            return _lastInput;
+            break;
+        case InputPauses:
+            return _counter > 0;
+        }
+    }
+    
     /** setTime
      * Used to set the timer value, in milliseconds.
      * @ingroup API