Skip to main content

Single Press

The following example demostrate how to detect a single press.

Download source code

#include <EasyButton.h>

// Arduino pin number where the button is connected.
#define BUTTON_PIN 26

// Button.
EasyButton button(BUTTON_PIN);

// Callback.
void onPressed() {
Serial.println("Button has been pressed!");

void setup() {

// Initialize the button.

// Attach callback.

void loop() {
// Continuously update the button state.;
Work on progress

We are currently working on this section.