Code Monkey home page Code Monkey logo

seqbutton's Introduction

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.

Usage

  • 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

Documentation

Doxygen doc can be generated using "Doxyfile".

See generated documentation

Release Notes

See release notes

seqbutton's People

Contributors

smfsw avatar

Stargazers

Erwin Ried avatar AJW  avatar Inbox Tech. avatar

Watchers

James Cloos avatar AJW  avatar  avatar

Forkers

eried

seqbutton's Issues

Button or pin in Callback

Hi,

Is there is any easy way to get the button or pin number in the callback? (to know which one triggered it)

Declaration Variable

Hi
Thank You
verry easy and good library

I found e Issue

holdDone is declared as uint8_t in SeqButton_h

used is only as boolean

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.