writePWMDutyCycle
Writes PWM duty cycle to PWM pin
Add-On Required: This feature requires the MATLAB Support Package for Raspberry Pi Hardware add-on.
Description
writePWMDutyCycle(
writes the duty cycle of the output square wave to the output pin.mypi
, pinNumber
, dutyCycle
)
The PWM uses a software implementation allowing all GPIO pins on the Raspberry Pi® hardware board to operate as a PWM pin. Each PWM pin outputs a square
waveform with variable frequency, duty cycle, or average voltage. A duty cycle of
0
means the waveform is always low and a duty cycle of
1
means the waveform is always high.
To use a PWM pin, reconfigure one of the multiple-use GPIO pins as a PWM pin.
Input Arguments
Examples
Extended Capabilities
Version History
Introduced in R2016b