How to use Button2 library from Lennart Hennigs for counting

Hi,
I am using Button2 library for one of my projects. I would like to count from button that has been pushed and till it has been released. I have already completed my interface using Button2 library. So it is difficult for me to change the button2 library.

Kindly support me on this issue.

It's not clear what your problem is or what you're asking or what you're stuck with.

And what does this mean:

Sorry for that.
I am using Button2 library for my project. I need to increase the value of a variable when the button is pressed too long and to increment by 1 when it is pressed only once.

The example "Single Button" with the library shows a variety of functions, including click() and longClick(). Those functions are called when a click or long click is completed, so why not do your incrementing in there?

Thank you for the advice. I was trying different once. Now it works.

1 Like