Skip to content

asukiaaa/arduino-button

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arduino-button (button_asukiaaa)

This library supplies useful functions to manage button behavior on Arduino.

Usage

See an example project.

Include

#include <button_asukiaaa.h>

Define with gpio pin

#define PIN_BTN 10
button_asukiaaa::Button btn(PIN_BTN);

Call update in loop to check pin state

void loop() {
  btn.update();
}

Call process on changed to release or press

if (btn.changedToPress()) {
  // process on change to press
} else if (btn.changedToRelease()) {
  // process on change to release
}

Call process by button state

if (btn.isPressing()) {
  // process during pressed
} else { // btn.isReleasing()
  // process during released
}

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages