#include <gurdybutton.h>
◆ GurdyButton()
GurdyButton::GurdyButton |
( |
int |
my_pin, |
|
|
int |
interval |
|
) |
| |
Constructor. This class handles simple push-on, release-off buttons.
- Parameters
-
my_pin | The digital pin this button is connected to |
interval | The debounce interval for this button |
This class assumes the button is wired up as an active-low button. It applies the internal pullup resistor.
◆ beingPressed()
bool GurdyButton::beingPressed |
( |
| ) |
|
Reports if the button is being pressed this update() cycle.
- Returns
- True if button is actve, false otherwise.
◆ update()
void GurdyButton::update |
( |
| ) |
|
Polls the button and updates its state.
This should be run every loop() even if the results are not used.
◆ wasPressed()
bool GurdyButton::wasPressed |
( |
| ) |
|
Reports if the button was pressed down this update() cycle.
- Returns
- True if button was just pressed down, false otherwise.
◆ wasReleased()
bool GurdyButton::wasReleased |
( |
| ) |
|
Reports if the button was released this update() cycle.
- Returns
- True if button was just released, false otherwise.
◆ being_pressed
bool GurdyButton::being_pressed |
|
protected |
◆ bounce_obj
Bounce* GurdyButton::bounce_obj |
|
protected |
The documentation for this class was generated from the following files: