I using the simple button event sample. Here is the code
#include <ezButton.h>
ezButton button(38); // create ezButton object that attach to pin 7;
void setup() {
Serial.begin(115200);
}
void loop() {
button.loop(); // MUST call the loop() function first
if(button.isPressed())
Serial.println("The button is pressed");
if(button.isReleased())
Serial.println("The button is released");
}
This is the serial ouput
The button is released
The button is pressed
The isReleased fires before the isPressed. Why? These are momentary on switches.