Library for debouncing inputs, originally by Andres Mora Bedoya. Updated to include PinMode capability and class documentation.

Fork of DebouncedIn by Andrés Mora Bedoya

Revision:
2:261228f701a1
Parent:
1:7b8a80c09b8c
Child:
4:e88ec98d2b7e
--- a/DebouncedIn.h	Wed Oct 08 14:44:47 2014 +0000
+++ b/DebouncedIn.h	Wed Oct 08 15:14:31 2014 +0000
@@ -26,7 +26,8 @@
               *
               *  @returns
               *    An integer representing the state of the input pin,
-              *    0 for logical 0, 1 for logical 1
+              *    0 for logical 0, 1 for logical 1. State changes when input 
+              *    has been steady for at least 40ms (8 ticker cycles of 5ms).
               */
              int read (void);
              
@@ -34,28 +35,29 @@
               */
              operator int();
               
-             /** Register the input changing from low to high (int)
+             /** Rising edge count (int)
               *
               *  @returns
-              *    An integer representing if the input changed from low to high,
-              *    0 for logical 0, 1 for logical 1
+              *    An integer representing the number of times the switch has
+              *    changed from low to high. Count resets to zero when this
+              *    function is called.
               */
              int rising(void);
              
-              /** Register the input changing from high to low (int)
+              /** Falling edge count (int)
               *
               *  @returns
-              *    An integer representing if the input changed from high to low,
-              *    0 for logical 0, 1 for logical 1
+              *    An integer representing the number of times the switch has
+              *    changed from high to low. Count resets to zero when this
+              *    function is called.
               */
              int falling(void);
              
-              /** Check steady state of input (int)
+              /** Steady state tick count (int)
               *
               *  @returns
-              *    An integer representing if the input has remained 
-              *    steady for a set amount of time,
-              *    0 for logical 0, 1 for logical 1
+              *    An integer representing how many ticker cycles the input has been
+              *    steady for. Ticker cycles every 5ms.
               */
              int steady(void);