Giter VIP home page Giter VIP logo

arduino-buttons's Introduction

Arduino Buttons Library

Project Status: Unsupported โ€“ The project has reached a stable, usable state but the author(s) have ceased all work on it. A new maintainer may be desired.

An interrupt-driven, fully-debounced class to manage input from physical buttons on the Arduino platform.

Although in principle this class is compatible with all members of the Arduino platform, note that it is limited to only having buttons connected to those pins that accept interrupts - on the ARM boards (Due, Zero etc) this is all pins, but on AVR boards (e.g. Uno, Leonardo, Mega 2560, etc) these pins are in limited supply.

Note that for pragmatic reasons, this is a fully static class. This means you do not need to create any instances of it and access it using static syntax, e.g.

byte pins[] = {1, 2};
Buttons.begin(pins, 2);
if (Buttons.clicked(1)) {
  Serial.println("Button 1 Clicked!);
}
if (Buttons.clicked(2)) {
  Serial.println("Button 2 Clicked!");
}
Buttons.clearChangeFlag();
Buttons.end();

The class is fully documented internally, but I may write a full usage guide here later on.

Library Setup

Just put the buttons.hpp and buttons.cpp file into your sketch folder, then add #include "buttons.hpp" to your .ino source file and any other files that will reference the buttons class.

Comments, Requests, Bugs & Contributions

All are welcome. Please file an "Issue" in the Bug Tracker.

License

This library is licensed under the GNU LGPL v2.1, which can be found in the LICENSE file.

arduino-buttons's People

Contributors

alarm-siren avatar per1234 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

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.