| PBtnToggle
    | 
Single button connected directly to pin. More...
#include <PBtnToggle.h>
 
  
 | Public Member Functions | |
| PBtnToggle (int btn_pin, int pressed_state=HIGH) | |
| Initialize button handler by providing pin number and pin state on button press.  More... | |
| void | onPress (ToggleFunc callback) | 
| Set optional callback function to be called on button press event.  More... | |
| void | onLongPress (LongPressFunc callback) | 
| Set optional callback function to be called on button long press event.  More... | |
| void | onRelease (ToggleFunc callback) | 
| Set optional callback function to be called on button release event.  More... | |
| void | check () | 
| Check button state and trigger event callback functions.  More... | |
| int | getPin () | 
| Get pin number.  More... | |
Single button connected directly to pin.
This is the simplest way to handle buttons. Wire push button to any digital pin with pull-up or pull-down resistor.
| PBtnToggle::PBtnToggle | ( | int | btn_pin, | 
| int | pressed_state = HIGH | ||
| ) | 
Initialize button handler by providing pin number and pin state on button press.
| btn_pin | Digital pin number on Arduino where button is wired | 
| pressed_state | Pin state HIGH or LOW when button is pressed | 
| 
 | inherited | 
Check button state and trigger event callback functions.
This method must be called in loop()
| 
 | inherited | 
Get pin number.
| 
 | inherited | 
Set optional callback function to be called on button long press event.
| callback | Callback function pointer | 
| 
 | inherited | 
Set optional callback function to be called on button press event.
| callback | Callback function pointer | 
| 
 | inherited | 
Set optional callback function to be called on button release event.
| callback | Callback function pointer | 
 1.8.6
 1.8.6