{"id":22665051,"url":"https://github.com/smfsw/seqbutton","last_synced_at":"2026-04-19T15:03:29.350Z","repository":{"id":159708969,"uuid":"85633856","full_name":"SMFSW/SeqButton","owner":"SMFSW","description":"Handling filtered button pushes with callbacks for Arduino","archived":false,"fork":false,"pushed_at":"2025-05-06T21:51:31.000Z","size":725,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-27T12:13:25.612Z","etag":null,"topics":["arduino","arduino-library","button","callback","filter","handler","pin"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SMFSW.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-03-20T22:33:02.000Z","updated_at":"2025-05-06T21:51:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"f8d394a4-81cb-43df-a1b8-41013175aa62","html_url":"https://github.com/SMFSW/SeqButton","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/SMFSW/SeqButton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMFSW%2FSeqButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMFSW%2FSeqButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMFSW%2FSeqButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMFSW%2FSeqButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SMFSW","download_url":"https://codeload.github.com/SMFSW/SeqButton/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMFSW%2FSeqButton/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32010959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","arduino-library","button","callback","filter","handler","pin"],"created_at":"2024-12-09T13:18:59.114Z","updated_at":"2026-04-19T15:03:29.306Z","avatar_url":"https://github.com/SMFSW.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SeqButton\n\n[![author](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/SMFSW/a9a2b2a02fda1b33461d53ddfe69d649/raw/auth_SMFSW.json)](https://github.com/SMFSW)\n![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/SMFSW/a9a2b2a02fda1b33461d53ddfe69d649/raw/SeqButton_status_badge.json)\n[![license](https://img.shields.io/badge/License-BSD3-darkred.svg)](LICENSE)\n[![CodeFactor](https://www.codefactor.io/repository/github/smfsw/seqbutton/badge)](https://www.codefactor.io/repository/github/smfsw/seqbutton)\n\n![platform](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/SMFSW/a9a2b2a02fda1b33461d53ddfe69d649/raw/platform_INO.json)\n\n[![doxy](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/SMFSW/a9a2b2a02fda1b33461d53ddfe69d649/raw/tool_DOXY.json)](https://smfsw.github.io/SeqButton)\n[![re_note](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/SMFSW/a9a2b2a02fda1b33461d53ddfe69d649/raw/tool_RN.json)](ReleaseNotes.md)\n\nSequential Button Arduino Library\n\nHandling filtered button press with callbacks for push (with or without repeat) and release, logic, filtering time and sequences.\n\n## Usage\n\n- Declare a `SeqButton` instance (called `sb` below)\n- Create callback function(s) of type `void func()`\n- Initialize instance with `sb.init(uint8_t pin, void (*cbckON)(SeqButton*), void (*cbckOFF)(SeqButton*), bool repeat, bool logic=LOW, uint16_t filter=50)`\n  - `pin`: pin on which button is connected\n  - `cbckON`: callback function on press (`NULL` when no callback needed)\n  - `cbckOFF`: callback function on release (`NULL` when no callback needed)\n  - `repeat`: callback called repeatedly when set to true\n  - `logic`: Button logic: `LOW` for NO / `HIGH` for NC (internal pullup for input is enabled)\n  - `filter`: filtering time (in ms)\n- Call the handler in a loop using `sb.handler()` -\u003e handler returns the current button value (if needed)\n- `sb.getState()` or `sb.getButton()` can be used to get current button state at any time\n- `sb.getPin()` can be used to check pin assigned to instance\n- `sb.getHoldTime()` can be used on a release callback to get hold duration of button\n\n## Examples included\n\n- [AdvancedButton.ino](examples/AdvancedButton/AdvancedButton.ino): Toggle a LED at each button press (showing all init parameters)\n- [CallbacksExample.ino](examples/CallbacksExample/CallbacksExample.ino): Toggle a LED at each push on button 1 and at each release on button 2\n- [CombinationExample.ino](examples/CombinationExample/CombinationExample.ino): Prints messages to serial depending on combination read from inputs\n- [OffTimerButton.ino](examples/OffTimerButton/OffTimerButton.ino): Turns a LED on when button is pressed, turning off 1s after release\n- [RepeatButton.ino](examples/RepeatButton/RepeatButton.ino): Toggle a LED repeatedly when button pressed\n- [SequenceExample.ino](examples/SequenceExample/SequenceExample.ino): Prints messages to serial depending on sequence read from inputs\n- [TimingExample.ino](examples/TimingExample/TimingExample.ino): Toggle a LED at each push on button 1 or 2 if held for more than 1s\n- [ToggleButton.ino](examples/ToggleButton/ToggleButton.ino): Toggle a LED at each button press\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmfsw%2Fseqbutton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmfsw%2Fseqbutton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmfsw%2Fseqbutton/lists"}