|
PBtnToggle
|
Single button connected to PISO chip. More...
#include <PBtnTogglePISO.h>
Public Member Functions | |
| PBtnTogglePISO (int chip, int btn_pin, int pressed_state=HIGH) | |
| Initialize button handler by providing PISO chip data input (Dn) number, chip number and pin state on button press. More... | |
| void | check () |
| Not used. 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... | |
| int | getPin () |
| Get pin number. More... | |
Friends | |
| class | PBtnTogglePISOController |
Single button connected to PISO chip.
This is button instance that is wire to PISO (parallel-in/serial out) shift register such as 74HC165. Wire push button to PISO chip input pin with pull-up or pull-down resistor.
| PBtnTogglePISO::PBtnTogglePISO | ( | int | chip, |
| int | btn_pin, | ||
| int | pressed_state = HIGH |
||
| ) |
Initialize button handler by providing PISO chip data input (Dn) number, chip number and pin state on button press.
Data pin number value from 0 to 7. Referred as Dn in PISO data sheet. PISO chips can be daisy chained. First chip (with value 0) is one with Q7 (serial output from the last stage - pin 9) wired to Arduino.
| chip | Chip number starting from 0. |
| btn_pin | Dn number in PISO data sheet. Value from 0 to 7. |
| pressed_state | Dn pin state on button press. Value: HIGH or LOW |
| void PBtnTogglePISO::check | ( | ) |
Not used.
PISO buttons must be added to PISO controller and use PBtnTogglePISOController::check() 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 |
|
friend |
1.8.6