Any chance of someone adding a frequency input for the PWM node? ie so the PWM frequency can be changed? That would be really useful when driving different loads.
That would be great but the problem looks hard to solve in a universal way. Adjusting the PWM frequency precisely and at the pin level is only available on high-end controllers. If we’d take, say, Arduino Nano we actually have a very few choices which are set by so-called prescaler (hardware frequency divider). To make things worse, setting a custom prescaler will also affect other pins because they share the same hardware counter or even break the time counter.
Maybe the problem is solvable in other way? What are you trying to accomplish by changing the frequency?
Thank you for your reply. Setting the PWM frequency to suit the hardware is useful when driving motors and variable flow solenoid valves. eg some motors ‘sing’ if the frequency is too low and, most variable flow solenoid valves need a specific PWM frequency if they are to work correctly.