Skip to content

mateuscelio/arduino-button-debounce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

arduino-button-debouncer

Simple arduino based debounce routine implementation from the article "Embed With Elliot: Debounce Your Noisy Buttons, Part II".

Use example

  #include <Arduino.h>
  #include "button_debounce.h"
  
  debounce_t button_1 = {18, true, 0x0};

  void setup() {
    pinMode(button_1.pin, INPUT_PULLUP);
  }
  
  void loop(){
  
    if (button_pressed(&button_1)) {
      // Do something when clicked
    }
    
    if (button_pressed(&button_1) || is_button_down(&button_1)) {
      // Do something when clicked and hold 
    }
  
    delay(10)
  }
  

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages