PWM frequency (pwm.freq)¶
What it does: Change the frequency of already initialized PWM channels.

Inputs¶
frequency: new frequency in Hz.- Field
ID: PWM channel you want to edit.
Output¶
- none (command block).
When to use it¶
- Dynamic frequency change while the program is running.
- Tuning sound, engine or light outputs.
Tips and pitfalls¶
IDmust correspond to the channels initialized by thepwmblock.- Too high a frequency can have a lower effective duty resolution.
Generated Python example¶
pwm22.freq(int(2000))