#include <ezButton.h>
#define BUTTON_PIN_1 25
#define BUTTON_PIN_2 26
#define BUTTON_PIN_3 27
#define BUTTON_PIN_4 14
ezButton button1(BUTTON_PIN_1);
ezButton button2(BUTTON_PIN_2);
ezButton button3(BUTTON_PIN_3);
ezButton button4(BUTTON_PIN_4);
void setup() {
Serial.begin(115200);
button1.setDebounceTime(100);
button2.setDebounceTime(100);
button3.setDebounceTime(100);
button4.setDebounceTime(100);
}
void loop() {
button1.loop();
button2.loop();
button3.loop();
button4.loop();
if (button1.isPressed()){
Serial.println("The button 1 is pressed");
}
if (button1.isReleased()){
Serial.println("The button 1 is released");
}
if (button2.isPressed()){
Serial.println("The button 2 is pressed");
}
if (button2.isReleased()){
Serial.println("The button 2 is released");
}
if (button3.isPressed()){
Serial.println("The button 3 is pressed");
}
if (button3.isReleased()){
Serial.println("The button 3 is released");
}
if (button4.isPressed()){
Serial.println("The button 4 is pressed");
}
if (button4.isReleased()){
Serial.println("The button 4 is released");
}
}