This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

The Raspberry Pi PWM

The Raspberry Pi™ hardware board supports software pulse-width modulation (PWM) on all GPIO pins. When configured for PWM, each pin outputs a square waveform with variable frequency and duty cycle.

The minimum PWM output frequency is 0 Hz. The maximum PWM output frequency is 8 KHz using writePWMFrequency(mypi, 12, 8000).

A duty cycle of 0 means that the waveform is always low. A duty cycle of 1 means the waveform is always high.

To use a PWM pin, configure the GPIO pin as a PWM pin using the configurePin function.

To see the available GPIO pins on raspberrpi object, use the showPins function.


See Also

| |