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

PWMOut variable frequency not required, uses only one counter #23

Merged
merged 4 commits into from Dec 30, 2018

Conversation

plamponi
Copy link

@plamponi plamponi commented Dec 29, 2018

The ability to set the minimum frequency to 2000 requires variable_frequency=True for all four PWMOut objects. This consumes a counter for each object, and there aren't that many to go around.
If the minimum frequency is only checked, but not changed, then variable_frequency can be False and only one counter is used (assuming the frequency is the same for all the four PWMOut objects).
This way, external PWM drivers such as the PCA9685 are not strictly required.
Tested on ItsyBitsy M4 Express + DRV8833.

Copy link
Contributor

@siddacious siddacious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch @plamponi. If you're going to add a constraint to the arguments to the constructor, it would be helpful if you could also update the docstring for the constructor to let people know about it.

Otherwise this looks good

@plamponi
Copy link
Author

Thanks! Added Note to docstring about PWM frequency requirements. Also added my version of the example, and renamed the original example to indicate that it uses a PCA9685.

@siddacious siddacious merged commit a889448 into adafruit:master Dec 30, 2018
tannewt pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jan 4, 2019
Updating https://github.com/adafruit/Adafruit_CircuitPython_Motor to 1.4.0 from 1.3.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_Motor#23 from plamponi/pwm_freq
  > Merge pull request adafruit/Adafruit_CircuitPython_Motor#22 from ladyada/master
  > Merge pull request adafruit/Adafruit_CircuitPython_Motor#21 from sommersoft/readme_fix_travis
siddacious added a commit to siddacious/Adafruit_CircuitPython_Motor that referenced this pull request Mar 14, 2019
kattni added a commit that referenced this pull request Mar 14, 2019
Revert "Merge pull request #23 from plamponi/pwm_freq"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants