Beverly is a lightweight Arduino library for handling push buttons with debounce, long press detection and clean state transitions.
It is designed primarily for AVR microcontrollers, but works on any Arduino-compatible
architecture that provides pinMode(), digitalRead() and millis().
- Software debounce
- Press and release detection
- Long press detection (
BAction::Held) - Simple state-based API
- Minimal memory footprint
- Uses bitmask-based internal state (via Facebits)
- Download the library as a ZIP
- Open Arduino IDE
- Sketch → Include Library → Add .ZIP Library
Search for Beverly and install it directly.
See examples/button.ino
start() must be called in setup before using watch()
BAction::Held is reported continuously while the button remains pressed
Timing is handled using millis() with 16-bit overflow-safe logic