You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, and thanks for writing this useful library! Do you have any plans to implement the ability to set the PWM frequency, and would you be open to a PR that implements this? My L298N makes a pretty harsh whine at the frequency it's currently at.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi, thank you for your appreciation.
Unfortunately right now I don't have much time to spend on this project.
If you have a solution to the problem, it would be interesting to see it.
Thank you!
Hey @AndreaLombardo! Super late follow-up as I've only recently found time myself to look at this.
So the standard Arduino analogWrite() uses a set Hz value for its PWM, I think it's ~500-900Hz depending on IC/pin.
It's fairly easy to implement a frequency change on, e..g., an ESP-32 (which is the platform I'm using), but, doing so seems to conflict with the use of Arduino's functions which will expect the PWM to be at its standard frequency. Straying from such ruins the portability the library has, so its not much of a PR-able solution.
My next step is to see how Arduino manages cross-compatibility with its existing library. Also, Particle seems to have an API that's based on, and extends, Arduino, and their analogWrite()accepts a third argument for frequency. As they produce dev kits across multiple IC platforms, their codebase may hold some good tips!
I'll report back if/when I figure anything useful out (see you next year! 👋 😆)
Hi there, and thanks for writing this useful library! Do you have any plans to implement the ability to set the PWM frequency, and would you be open to a PR that implements this? My L298N makes a pretty harsh whine at the frequency it's currently at.
Thanks!
The text was updated successfully, but these errors were encountered: