-Pulse width in microseconds of the PWM signal `float pulse_width` is the length of time in which a GPIO pin remains set or cleared. Determining an appropriate pulse width is a function of the allocated memory pages, desired frequency range, and desired duty cycle resolution. See [raspberry_pi_dma_pwm.pdf](doc/raspberry_pi_dma_pwm.pdf) and ["dma_pwm_pulse_width_calculator"](doc/dma_pwm_pulse_width_calculator) for a discussion on how to calculate this for yourself, but several presets are available targeting an appropriate pulse width for servos `SERVO_PULSE_WIDTH`, D.C motors `MOTOR_PULSE_WIDTH`, and LEDs `LED_PULSE_WIDTH`. This defaults to `DEFAULT_PULSE_WIDTH` or 5 us. Use the following recommendations for frequency ranges for the above presets to achieve a duty cycle within 10% of desired at the default allocated memory:
0 commit comments