Pulse width modulation of digital output pin
Simulink Coder Support Package for BeagleBone Blue Hardware / Basic
The PWM block varies the power output of a digital output pin. The input value sets the percentage of time that the digital square-wave is on within a specific period. This time percentage is called duty cycle.
Port_1— Duty cycle value
The range of valid input is
0 - 100. The input controls the
duty cycle of the square waveform. An input value of
0 sets the
duty cycle to 0% or no power, while an input value of
100 sets the
duty cycle to 100% or full power. An intermediate input value, such as
0.333, sets the duty cycle to 33.3%, or 1/3 power. An
out-of-range input value, such as
outputs minimum or maximum power.
Pin— Select the digital output pin
Specify the digital output at which the block generates the PWM signal.
To view the pin mapping on the board, click View pin map.
Each block must have a unique pin number within a model.
Frequency— Frequency of the PWM signal
Set the frequency of the PWM signal. If there are two PWM blocks, set both the blocks to the same frequency.