Skip to content

Analog button value range #14

Answered by rlogiacco
karim622 asked this question in Q&A
Discussion options

You must be logged in to vote

Actually every value should be considered as a range:

the analog value margin which takes into account slight resistance fluctuations and ADC errors transforming the button value into a range (defaults to 10)

That's from the Analog pin definition documentation.

AnalogButtons(uint8_t pin, uint8_t mode, uint16_t debounce, uint8_t margin)

So, if your request is to have a margin customizable for each button that will require additional memory (which I always strive to keep as low as possible). The library can easily be adapted for such corner-case, but is it worth it?
I will accept a pull request to cover that, but only if it can be switched off via a macro so that only those needing it wil…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by rlogiacco
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #14 on December 17, 2020 12:58.