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

Make timer d PWM suck less #51

Closed
SpenceKonde opened this issue Jun 24, 2019 · 1 comment
Closed

Make timer d PWM suck less #51

SpenceKonde opened this issue Jun 24, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@SpenceKonde
Copy link
Owner

SpenceKonde commented Jun 24, 2019

Right now, you need to stop the timer, delay(1), and restart it to enable or disable PWM on a pin.

I would love to find a more graceful way of doing this, as it pulls in delay(), blocks for a millisecond, and makes a glitch on the other timer d pin.

I think if I moved the digitalWrite() tests for 0 and 255, and didn't use that shortcut for the timer d pins (and adjusted digital write to effectively analogWrite() the pin 0 or 255), I would get the desired behavior. If not in DS mode, maybe in a different mode - the different modes are very hard to understand from the datasheet. They clearly don't have people of the same caliber writing the datasheets now as they did in the classic AVR days.

@SpenceKonde
Copy link
Owner Author

My initial attempt was unsuccessful.

SpenceKonde added a commit that referenced this issue Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant