Skip to content
Handling filtered button pushes with callbacks for Arduino
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

SeqButton Build Status

Sequential Button Arduino Library

Handling filtered button press with callbacks for push (with or without repeat) and release, logic, filtering time and sequences.


  • Declare a SeqButton instance (called sb below)
  • Create callback function(s) of type void func()
  • Initialize instance with sb.init(uint8_t pin, void (*cbckON)(SeqButton*), void (*cbckOFF)(SeqButton*), bool repeat, bool logic=LOW, uint16_t filter=50)
    • pin: pin on which button is connected
    • cbckON: callback function on press (NULL when no callback needed)
    • cbckOFF: callback function on release (NULL when no callback needed)
    • repeat: callback called repeatedly when set to true
    • logic: Button logic: LOW for NO / HIGH for NC (internal pullup for input is enabled)
    • filter: filtering time (in ms)
  • Call the handler in a loop using sb.handler() -> handler returns the current button value (if needed)
  • sb.getState() or sb.getButton() can be used to get current button state at any time
  • sb.getPin() can be used to check pin assigned to instance
  • sb.getHoldTime() can be used on a release callback to get hold duration of button

Examples included


Doxygen doc can be generated using "Doxyfile".

See generated documentation

Release Notes

See release notes

You can’t perform that action at this time.