Description
Hello there,
Firstly I just wanted to thank you for your great job - this Arduino support for Pico you provided is just amazing!
Anyway, I'm building some hardware for my car project, and some of the engine solenoids requires a relatively low PWM frequencies (20-100Hz max).
I'm using two PWM channels on Pico otputs 9 and 10.
Following the docs, I was trying to change the PWM frequency using analogWriteFreq() with parameter 100, and I was expecting to get 100Hz as base frequency for my both PWM channels.
Unfortunately it seems that analogWriteFreq() does not take any effect, the minimum frequency I'm able to get is something around 1Khz. Is there any chance that I'm doing something wrong, and this can be fixed somehow?
I'm also using the analogWriteResolution() to set desired output resolution for PWM.
Here is the sample of my code:
#define PWM_WRITE_RESOLUTION 9
#define PWM_RESOLUTION 511
[...]
analogWriteFreq(100);
analogWriteResolution(PWM_WRITE_RESOLUTION);
analogWrite(pin, (PWM_RESOLUTION - val));
Thanks in advance for any hint or help!
Best,
Marcin