Skip to content

Commit 1fc2971

Browse files
committed
Added attachInterrupt() code
1 parent 1369224 commit 1fc2971

4 files changed

Lines changed: 8 additions & 10 deletions

File tree

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# EasyButton
2-
Arduino library for handling push buttons at INT0 and / or INT1 pin (pin 2 / 3).<br/>
3-
The library is totally based on interrupt.<br/>
4-
Debouncing is implemented in a not blocking way! It is merely done by ignoring a button change within the debouncing time.
2+
Arduino library for handling push buttons connected between ground and INT0 and / or INT1 pin (pin 2 / 3).<br/>
3+
The library is totally based on interrupt and debouncing is implemented in a not blocking way. It is merely done by ignoring a button change within the debouncing time.
54

65
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
76
[![Build Status](https://travis-ci.org/ArminJo/EasyButtonAtInt01.svg?branch=master)](https://travis-ci.org/ArminJo/EasyButtonAtInt01)

examples/OneButton/OneButton.ino

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,12 @@ EasyButton Button0AtPin2(true);
3434

3535
void setup() {
3636
// initialize the digital pin as an output.
37-
pinMode(LED_BUILTIN, OUTPUT);
37+
// pinMode(LED_BUILTIN, OUTPUT); // not needed here, since it is done by button library
3838
Serial.begin(115200);
3939
while (!Serial)
4040
; //delay for Leonardo
4141
// Just to know which program is running on my Arduino
4242
Serial.println(F("START " __FILE__ "\r\nVersion " VERSION_EXAMPLE " from " __DATE__));
43-
4443
}
4544

4645
void loop() {

library.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name=EasyButtonAtInt01
2-
version=1.0
2+
version=1.0.0
33
author=Armin Joachimsmeyer
44
maintainer=Armin Joachimsmeyer <armin.joachimsmeyer@gmail.com>
5-
sentence=Arduino library for handling push buttons at INT0 and / or INT1 pin (pin 2 / 3)
6-
paragraph=Just attach buttons to pin 2 or 3 of your Arduino - thats it. In you main program define a EasyButton and use ButtonStateIsActive or ButtonToggleState to determine your action. Or use a callback function called once on every button press. If timing does matter, 3 more variables are available: ButtonPressDurationMillis, ButtonLastChangeMillis and ButtonReleaseMillis.
7-
category=Input
5+
sentence=Small and easy to use Arduino library for using push buttons at INT0 and / or INT1 pin (pin 2 / 3) using interrupts.<br/>No call of begin() or update() function needed. No blocking debouncing.<br/><br/>
6+
paragraph=Just connect buttons between ground and pin 2 or 3 of your Arduino - thats it.<br/><br/>In you main program define an EasyButton and use <i>ButtonStateIsActive</i> or <i>ButtonToggleState</i> to determine your action.<br/>Or use a callback function which will be called once on every button press.<br/><br/>Usage:<pre>#define USE_BUTTON_0<br/>#include "EasyButtonAtInt01.h"<br/>EasyButton Button0AtPin2(true);<br/><br/>void setup() {}<br/>void loop() {<br/>...<br/> digitalWrite(LED_BUILTIN, Button0AtPin2.ButtonToggleState);<br/>...<br/>}</pre><br/>If button timing is of interest, 3 variables are available:<ul><li>ButtonPressDurationMillis</li><li>ButtonLastChangeMillis</li><li>ButtonReleaseMillis</li></ul>
7+
category=Signal Input/Output
88
url=https://github.com/ArminJo/EasyButtonAtInt01
99
architectures=avr

src/EasyButtonAtInt01.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* EasyButtonAtInt01.h
33
*
4-
* Arduino library for handling push buttons at INT0 and / or INT1 pin (pin 2 / 3).
4+
* Arduino library for handling push buttons connected between ground and INT0 and / or INT1 pin (pin 2 / 3).
55
* The library is totally based on interrupt.
66
* Debouncing is implemented in a not blocking way! It is merely done by ignoring a button change within the debouncing time.
77
*

0 commit comments

Comments
 (0)