Skip to content

9glt/arduino-button

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arduino-button

check if pin state changed

example usage

#include "Button.h"

Button button1(7, LOW); // LOW for input pullup HIGH for INPUT
Button button2(8, LOW, 1000); // 1000 - debaunce delay

void setup() {
    Serial.begin(9600);
}

void loop() {
    if(button1.down()) {
        Serial.println("CLICK!");
    }
    if(button2.debounce()) {
        Serial.println("debounce click");
    }
}