# mathertel/OneButton

An Arduino library for using a single button for multiple purpose input.

Repository: https://github.com/mathertel/OneButton
Canonical: https://ross.abutalabs.com/products/onebutton
Homepage: http://www.mathertel.de/Arduino/OneButtonLibrary.aspx
Language: C++
License: NOASSERTION
License Family: other
Topics: arduino-library, arduino, button
Last push: 2026-02-20T21:15:16+00:00

## Health v2 (maintenance only)
Score: 64/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 68, release rhythm 39, longevity 100
- inputs: {"age_days": 4630, "days_push": 194, "days_rel": 194, "gap_med": null, "n_releases_24m": 1}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1108, forks 246 (observed 2026-08-28T04:03:37.120004+00:00)

## What it is
An Arduino C++ library that detects single clicks, double clicks, and long presses from a single pushbutton attached to one digital input pin, allowing one button to serve multiple input functions. It uses a non-blocking tick() function and a finite-state machine, with a lightweight OneButtonTiny variant for small processors.

## Use cases
- detect single, double, and long button presses on Arduino
- use one physical button for multiple functions
- debounce a pushbutton without blocking the main loop
- attach callback functions to button press events
- read button input on ATtiny microcontrollers with limited memory

## When to choose
- you have limited input pins and want one button to trigger multiple actions
- you need non-blocking button event detection in an Arduino sketch
- you want simple debouncing and click/press event callbacks out of the box

## When to avoid
- you need multi-button matrix scanning or touch input
- your project is not on an Arduino-compatible embedded platform

## Facets
- artifact type: library
- maturity: stable
- function: embedded
- domain: embedded-systems, hardware, developer-tools
- platform: embedded, cpp, iot
- tags: arduino-library, push-button, debouncing, finite-state-machine, input-handling, event-handling

## Member repositories
- mathertel/OneButton (main) score 64

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:37.120004+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:43:50.302936+00:00, confidence not recorded.
  - readme: https://github.com/mathertel/OneButton (fetched 2026-08-28T04:03:37.120004+00:00, sha 307dd0f3dfd6)
  - homepage: http://www.mathertel.de/Arduino/OneButtonLibrary.aspx (fetched 2026-08-29T12:47:25.350128+00:00, sha 190c60b85c15)
- Data as of 2026-08-30T08:39:29.467469+00:00.
