Arduino library for handling push buttons. Supports push buttons wired to Arduino digital pin or thru PISO (parallel-in/serial out) chip like 74HC165.
Arduino library for handling push buttons. Supports push buttons wired to Arduino digital pin or thru PISO (parallel-in/serial out) chip like 74HC165 with support to daisy chain multiple chips. Automatic handling of debounsing. Buttons have push event, long push event and release event.
https://www.youtube.com/watch?v=McYEGBtuxOA
Create toggle button instance in global scope:
PBtnToggle* btn = new PBtnToggle(7, HIGH);
Register some callback functions:
void setup() {
btn->onPress(onButtonPress);
btn->onLongPress(onButtonLongPress);
btn->onRelease(onButtonRelease);
}
Check() method must be called in loop(). Additionally, check() van also be called by external interrupts:
void loop() {
btn->check();
}
Example using one button connected to Arduino digital pin: examples/one_button/one_button.ino
Example using two daisy chained PISO chips 74HC165: examples/piso_buttons/piso_buttons.ino