button
¶
Button Utilities.
Including debouncing of the button.
Classes:
| Name | Description |
|---|---|
Button |
Button class. |
Functions:
| Name | Description |
|---|---|
test_button |
Test for the Button class. |
Button
¶
Button(button_pin: int)
Button class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
button_pin
|
int
|
The pin the button of the encoder is connected to. |
required |
Methods:
| Name | Description |
|---|---|
button_changed |
Indicates if the button value changed since the last call to this method. |
get_button |
Get the button value. |
Source code in src/aalec/button.py
18 19 20 21 22 23 24 25 26 27 28 | |
button_changed
¶
button_changed() -> bool
Indicates if the button value changed since the last call to this method.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
|
Source code in src/aalec/button.py
38 39 40 41 42 43 44 45 46 47 48 49 | |
get_button
¶
get_button() -> int
Get the button value.
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
Value of the button. Button pressed: |
Source code in src/aalec/button.py
30 31 32 33 34 35 36 | |
test_button
¶
test_button() -> None
Test for the Button class.
Source code in src/aalec/button.py
65 66 67 68 69 70 71 72 73 | |