For beginners: The simple way to program for multiple buttons

Pesky Characters.. :o again thanks so much :slight_smile:

Hi
Is it possible to define both times that is for Low and high:
For example, correct code as per library is:

type or pasbutton.setDebounceTime(50);

This is for both debounce i.e on low and high.

Is it possible to do something like this

button.setDebounceLOWTime(500);
button.setDebounceHIGHTime(500);

Or is it possible to amend library somehow to predefine HIGH time?

im not sure if this is the right place, but im playing with ezButton library, just trying to figure it out by compiling lots of simple sketches and seeing if they work.
this is just a few lines where im trying to change a counter with two buttons.
i got the counter to go up and down by using ++ and -- but i want to do it differently this time.
i cant figure out why but it always starts at 97 rather than the 0 i specified.
anyway this code doesnt do what i want and need a little help figuring out what im doing wrong.
no error code btw.

#include <ezButton.h>

ezButton button1 (2);
ezButton button2 (3);

void setup() {
Serial.begin (9600);
button1.setDebounceTime(40);
button2.setDebounceTime(40);

int counterPrev = 0;
int counterNew = 0;

}

void loop() {

int counterPrev;
int counterNew;

button1.loop();
button2.loop();

if(button1.isPressed())
counterNew = (counterPrev + 5);
counterPrev = (counterNew);
Serial.println(counterNew);

if(button2.isPressed())
counterNew = (counterPrev - 5);
counterPrev = (counterNew);
Serial.println(counterNew);

}

I am sorry for the late reply.
The counterPrev variable should be the global variable

I am sorry for the late reply.
Currently, it is impossible. But you can freely modify the source code to make it work as your desire.