Hi everyone.
The button2.h got example of multi buttons of 2, can it handle many buttons like 4?
any examples please.
Thanks
Adam
Let's turn the question round the other way
How many buttons do you need ?
thanks.
I need 4 buttons.
Have you tried 4 buttons ?
yes,
not working well, asking if no possible for 4, or I'll try more coding.
thanks
Post what you tried
What do you do in the callback? How long do they take to execute?
+1 on posting your code
![]()
Who needs a libary to run a button manager ?
Nobody needs a library to do anything, but it can make things simpler. I assume that you use libraries in your sketches, if so, why ?
Do you understand the purpose of a retorical question?
Are you asking that in order to create a dramatic effect or to make a point rather than to get an answer ?
That sounds like a rhetorical question
.
I've used the Button2 library to control 8 buttons and it can handle even more. So, you won't have a problem.
The button2 library can discern single, double, and triple clicks, long presses, and releases (including all of the debouncing). All with just declaring the button in a constructor and then calling the button loop function. For a beginner, trying to do all of that on your own in the sketch would be a very daunting task. I was able to build a device that has 8 buttons and neopixel LEDs to send button presses and receive commands for the LEDs from my home automation system and run a webserver for configuration with only 408 lines of code. Trying to do all of those functions manually would have been a huge undertaking. Why re-invent the wheel?
or a rhetorical affirmation .. it's like asking "Do bears shit in the woods?" ![]()
Do bears shit in the woods
![]()
Oh, that was rhetorical
.
![]()
...