Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update attachInterrupt notes about mechanical switch chatter #576

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PaulStoffregen
Copy link

Hopefully this small addition will help uses avoid a common pitfall with mechanical chatter.

@robsoncouto
Copy link
Contributor

Hi Paul, thanks for the contribution.
I am afraid it may not be accepted as it is though, because it contains a link to an external library. Please see #467.

...our policy is not to allow links to external resources that we can't control or maintain. Therefore, we cannot approve this pull request...

This will need a review from an Arduino employee (I am just a volunteer here).

Thanks again!

@PaulStoffregen
Copy link
Author

Oh if only Arduino had a debouncing feature built in. This is one of the very common problems users face.

@per1234 per1234 requested a review from smellai March 31, 2019 09:49
@per1234
Copy link
Collaborator

per1234 commented Mar 31, 2019

Since @smellai was the person to mention this policy, I have requested a review.

Bounce2 is in the Arduino Library Manager so, if the link is not allowed, an alternative would be to change the text to something like:

The Bounce2 library found in the Arduino Library Manager is often a better choice than attachInterrupt() to reliably detect changes from mechanical switches.

However, there is something to be said for being able to just click on a link and have a quick look at the library.

@PaulStoffregen
Copy link
Author

Thanks! :)

The Bounce2 page's readme has 2 very nice waveform captures that show real waveforms with annotation. I know how many forum questions you answer. I'm sure you've many times encountered users confused by "random" results from mechanical chatter.

Might also be worth mentioning the main libraries page in the Arduino reference section links to an older version of this Bounce library. It's been around for a very long time, since at least Arduino version 0012.

@per1234
Copy link
Collaborator

per1234 commented Mar 31, 2019

I'm sure you've many times encountered users confused by "random" results from mechanical chatter.

Yes, we even had an issue previous to #575 in this repository that I interpreted to be the same problem: #414. I don't think we've seen many other topics come up with that frequency in this repo, so this indicates to me that it's important to explain this issue in the documentation.

Other references:

Might also be worth mentioning the main libraries page in the Arduino reference section links to an older version of this Bounce library. It's been around for a very long time, since at least Arduino version 0012.

I'd prefer to see that resolved at the root of the problem by simply removing the "Contributed Libraries" section from that page, since it's really not realistic or sensible to expect that Arduino will maintain such content: arduino/Arduino#5291 (comment)

@SimonePDA
Copy link

Hello, I am discussing with the Content Team the right solution to this issue of the "Contributed Libraries" list. I'll update you as soon as we decide how to manage it.

Simone

@PaulStoffregen
Copy link
Author

Maybe this PR should be closed? Looks like Arduino is never going to update the documentation with helpful info, if any mention is made of a library.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@per1234 per1234 linked an issue Feb 27, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add note re: contact bounce to attachInterrupt reference
5 participants