Skip to content

meirarc/Button

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

βš™ Button

Button library for ESP32 created to build a simple object related to a push button. This library avoid to know how to create the logic to get the button working. Instead, it allows to define a simple code to set the button code.

⚑ Install

  1. Download the code
  2. Add the folder under Arduino/libraries
  3. Restart Arduino IDE

πŸ”§ Library details

Public functions:

  • Button(int pin)

    Contructor, inform the pin to set up an INPUT_PULLUP button

  • void isPressed()

    Return true if the button is pressed.

πŸ–Œ Example

#include <Led.h>        // https://github.com/meirarc/Led.git
#include <Button.h>     // https://github.com/meirarc/Button.git

Led led_built_in(LED_BUILTIN);
Button buttom(0);

void setup() {
}

void loop() {
  if(buttom.isPressed()) led_built_in.on();
  else led_built_in.off();
}

πŸ™‹β€β™‚οΈ Support & Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request if you have a way to improve this project.

Make sure your request is meaningful and you have tested the app locally before submitting a pull request.

πŸ’™ If you like this project, give it a ⭐ and share it with friends!

Releases

No releases published

Packages

No packages published

Languages