I'm looking at the library reference page, and I see the following:
I have some questions regarding the feature set and the library files.void begin(uint16_t freq = 1600);
begin() must be called in setup() to initialize the shield. An optional frequency parameter can be used to specify something other than the default maximum: 1.6KHz PWM frequency.
first is in regards to the "default maximum". Is this indicating that the 1600 is the ceiling that is set by putting that code in setup (i.e. it can be, say... 3200hz if replaced with "3200"?), or is that just the maximum frequency this Motorshield provides via the onboard chip. I do not see any indication of what the minimum and maximum tolerable PWM frequencies available are. If I were to guess, by comparing to the PWM Shield you provide, it looks to be the same chip that is the brain of the system. And that is rated at 40-1600hz, so the Motorshield V2 is also the same rating, correct? Perhaps putting this in the description for the Motorshield might be a good idea, or perhaps even the FAQ (or pointing to it, because I may have missed it).
second is in regards to modifying the frequency after boot-time. Is it ok to move the "void begin(uint16_t freq = 1600)" code into a different loop instead of having it in the setup loop? Can I bring it into an conditional statement to modify the PWM frequency based on certain events, button presses, etc.? I'm unsure if initializing it in the setup loop is a requirement for this shield.
lastly... if 40 is the minimum frequency this shield allows, what recommendation would you provide in order to provide a range down to 15 or 20hz minimum, instead of the 40-1600hz range. I was hoping to bypass the internal PWM circuitry of the Arduino UNO R3 so that I can have a variably adjustable signal to control a non-polarized solenoid by disguising it as a DC motor and using this shield to drive it while being able to fine tune the frequency as well as the duty cycle.