← Back 
arduino library

Beverly

Lightweight Arduino library for push button handling. Debounce, press, release, hold and double-press. Everything on ~100 LoC

C++ AVR Arduino
Take a look ↗

Beverly

Button Events for AVR Easily.

Beverly is a minimal Arduino library for handling push buttons cleanly. It covers the full event surface you actually need: debounce, press, release, hold and double-press. in under 60 lines of code, with a negligible memory footprint.

It targets AVR microcontrollers but runs on any Arduino-compatible architecture that exposes pinMode(), digitalRead() and millis().

Events

  • Idle - button untouched
  • Pressed - on press
  • Released - on release
  • Held - reported continuously while held down
  • DoublePressed - double-press detection

Design notes

Internal state is managed through a bitmask via Facebits. Timing uses millis() with 16-bit overflow-safe logic, so it behaves correctly even on long-running sketches.

start() must be called in setup() before using watch().

Installation

Available through the Arduino Library Manager: search for Beverly. Alternatively, download as ZIP and add via Sketch → Include Library → Add .ZIP Library.


Licensed under the MIT License.