Digigurdy-baz
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ToggleButton Class Reference

#include <togglebutton.h>

Inheritance diagram for ToggleButton:
GurdyButton ExButton

Public Member Functions

 ToggleButton (int my_pin, int interval)
 Constructor. This extends GurdyButton with a toggle on/off feature. More...
 
void update ()
 Samples the button and determines toggle status. More...
 
bool toggleOn ()
 Returns the toggle status of the button. More...
 
void setToggle (bool new_toggle)
 Forcibly sets the toggle status of the button. More...
 
- Public Member Functions inherited from GurdyButton
 GurdyButton (int my_pin, int interval)
 Constructor. This class handles simple push-on, release-off buttons. More...
 
void update ()
 Polls the button and updates its state. More...
 
bool beingPressed ()
 Reports if the button is being pressed this update() cycle. More...
 
bool wasPressed ()
 Reports if the button was pressed down this update() cycle. More...
 
bool wasReleased ()
 Reports if the button was released this update() cycle. More...
 

Additional Inherited Members

- Protected Attributes inherited from GurdyButton
Bounce * bounce_obj
 
bool being_pressed
 

Constructor & Destructor Documentation

◆ ToggleButton()

ToggleButton::ToggleButton ( int  my_pin,
int  interval 
)

Constructor. This extends GurdyButton with a toggle on/off feature.

Parameters
my_pinThe digitial voltage pin to be used.
intervalThe debounce interval to be used.

Member Function Documentation

◆ setToggle()

void ToggleButton::setToggle ( bool  new_toggle)

Forcibly sets the toggle status of the button.

Parameters
new_toggleTrue = toggled on, false = toggled off

◆ toggleOn()

bool ToggleButton::toggleOn ( )

Returns the toggle status of the button.

Returns
True if toggled on, false otherwise

◆ update()

void ToggleButton::update ( )

Samples the button and determines toggle status.


The documentation for this class was generated from the following files: