The Arduino has a fixed PWM frequency of 490Hz - or does it? On digital pins 3, 9, 10 and 11 it's 490Hz, but on pins 5 and 6 it's 976Hz. Confused?
And it is possible to change the PWM frequency to a higher (or lower) frequency by altering the timer prescalers. Here's how it's done.
And it is possible to change the PWM frequency to a higher (or lower) frequency by altering the timer prescalers. Here's how it's done.
i don't get why it is so hard to change the frequency, I still don't get how it works and have to copy pre made code
THANK YOU. This is huge for driving any non-trivial load off an Arduino pin. For an LED, it's fine. But if you want to drive some other entire circuit module, maybe some transistor circuit, etc, and you need to approximate smooth DC, a PWM at high frequency can very efficiently and simply be filtered to reasonably smooth DC with a small cap and resistor, much more easily (and with quicker response) than low freq 490 Hz PWM.
Its varying the duty cycle 🥲
I think you'll find that the discrepancy between the expected and measured nominal 31Khz frequency at the end of the video is down to being on too slow a 'scope range, if you set to 1us/div you'll likely be closer to target.
Plz code 3-phase
Hello
can i reduce frequency to 10hz
This is many moons old, but would like to ask how you got the PWM library to install. I've had no luck!
Tried installing from manage libraries but it doesn't show up and tried the include library/zip file from the sketch. Just says the PWM.h file doesn't exist. Most frustrating.
Excellent as usual
Can you run HDD ~18000RPM
With controlled speed
By this arduino
I will pay for this
It's part of my huge project..
Very helpful
Was fumbling around for 3 days looking for this. This will help on my arduino audio school project. Thanks!!!
Thank you so much Julian, it's a excellent tutorial.
Regards from Colombia!