-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
allow to set pin to OUTPUT_OPEN_DRAIN in analogWriteMode #7841
Conversation
The problem w/this PR is that Maybe an |
Thanks, I just noticed that.
I named it analogWriteMode() but we can rename it to analogWriteEx()
I think digitalWrite() does not set pin mode to OUTPUT or does it? |
No problem, your name makes sense.
That's correct, my mistake. I just checked upstream, too, and that's the Arduino way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thx! Need other maintainer to give 👍 to merge since it does add a new API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I just saw that my editor removed a lot of whitespaces in |
@klugem you got the spaces thing fixed, but there's now a regression of a submodule, SoftwareSerial. Easiest thing to do is go to the libraries/SWSerial directory and |
This was caused because I clicked on "Update branch"...I reverted this commit. |
@earlephilhower This commit is not OK, despite reviews. What is the intended function on an "open" analogWrite? You can't switch the mode in that case due to the "else":
Plus, the comment about on and off has drifted far from anything that it might apply to :-) |
I added an optional parameter in the analogWrite() function to allow open-drain PWM signals.
Also see #7836
edit: closes #7836