|
1 | 1 | # ButtonSuite |
2 | 2 |
|
3 | | -A class for adding functionality to momentary buttons. Includes debouncing. This library includes the following types of buttons: |
| 3 | +A class for adding functionality to push (momentary) buttons. Includes debouncing. This library contains two categories of class, two state buttons and incrementing buttons. |
4 | 4 |
|
5 | | -#### PushButton |
6 | | -This is standard momentary button. It returns true when the button is pressed and false when it is not. |
| 5 | +### Two State Buttons |
| 6 | +These buttons are either on or off. |
7 | 7 |
|
8 | | -#### ToggleButton |
9 | | -Turns a push button (momentary button) into a toggle button (latching button). Pressing the button alternates between on true) and off (false). If the button is pushed once to turn in on (true) it will continue to return on (true) until the button is pushed again. This effectively creates a virtual latching switch controled by a momentary button. The toggle button can be reset to the base (known) state by the user (with a long press, if enabled) or programmically. |
| 8 | +#### SimpleButton |
| 9 | +Abstract base class that provides interface for a two state button (button that only has an on and off state). You cannot instantiate (create an instance) of this class. |
10 | 10 |
|
11 | | -#### PushButtonCounter |
12 | | -Turns a push button (momentary button) into a counter. The counter is incremented each time the button is pushed. The counter continues to increment until it is reset by either the user (with a long press, if enabled) or programically reset. |
| 11 | +The purpose of this class is to provide automatic implimentation of different behaviors. By using different classes derived from SimpleButton, a class can automatically implement momentary, latching, always on, or always off behavior. This makes it easy to implement different behaviors or even switch behaviors during run time. |
| 12 | + |
| 13 | +#### MomentaryButton |
| 14 | +This is standard push (momentary) button. It returns true when the button is pressed (held down) and false when it is not. |
| 15 | + |
| 16 | +#### LatchingButton |
| 17 | +Turns a push button (momentary button) into a toggle button (latching button). Pressing the button alternates between on (true) and off (false). This is a virtual latching switch controled by a real momentary button. The toggle button can be reset to the base (known) state by the user (with a long press) or programmically. |
| 18 | + |
| 19 | +#### AlwaysOnButton |
| 20 | +Always returns true (on). |
| 21 | + |
| 22 | +#### AlwaysOffButton |
| 23 | +Always returns false (off). |
| 24 | + |
| 25 | +### Incrementing Buttons |
| 26 | +These buttons have multiple states. |
| 27 | + |
| 28 | +#### CountingButton |
| 29 | +Turns a push button (momentary button) into a counter. The counter is incremented each time the button is pushed. The counter continues to increment until it is either reset by the user (with a long press) or reset programically. |
13 | 30 |
|
14 | 31 | #### CycleButton |
15 | | -Turns a push button (momentary button) into a button used to cycle through states. Pressing the button causes the value to increment. Once the maximum value is reached, the value automatically resets to the initial value. The value can also be reset to the initial value by the user (with a long press, if enabled) or programmically reset. |
| 32 | +Turns a push button (momentary button) into a button used to cycle through states (for example, an enum). Pressing the button causes the value to increment. Once the maximum value is reached, the value automatically resets to the initial value. The value can also be reset to the initial value programmically or by the user (with a long press). |
16 | 33 |
|
17 | 34 |
|
18 | 35 | ## About the Library |
@@ -43,4 +60,4 @@ We use [SemVer](http://semver.org/) for versioning. |
43 | 60 |
|
44 | 61 | ## License |
45 | 62 |
|
46 | | -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
| 63 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
0 commit comments