Pwm frequency, help please


#1

So I know arduino has a frequency of about 400 herts on it’s pwm outputs, but how do I lower that value to something lower? I want about 100hz, not 1khz


#2

hi, there are some arduino libraries for softpwm, but I’m not sure I can do it.
Maybe someone with C++ domain could do it. @bradzilla84 :wink:

here the link
https://github.com/Palatis/arduino-softpwm


#3

See https://playground.arduino.cc/Main/TimerPWMCheatsheet
See the “divisor” table in there.

It should be pretty easy to make a XOD node to modify PWM rates, but be careful: TCCR0B also controls the millis() timer, so clocks would be off! Also, there is something about prescale values for UNO’s.

So, you should be able to get to ~122Hz. Your choices of the rate are very limited though.

If you can’t figure it out, you can ask me, but it may take me a while to write a patch.