Skip to content

Commit baac154

Browse files
authored
Update README.md
1 parent afb5d9d commit baac154

1 file changed

Lines changed: 26 additions & 9 deletions

File tree

README.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,35 @@
11
# ButtonSuite
22

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.
44

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.
77

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.
1010

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.
1330

1431
#### 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).
1633

1734

1835
## About the Library
@@ -43,4 +60,4 @@ We use [SemVer](http://semver.org/) for versioning.
4360

4461
## License
4562

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

Comments
 (0)