Writes PWM duty cycle to PWM pin
The BeagleBone Black board has eight PWM output pins. 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
the waveform is always high.
To use a PWM pin, reconfigure one of the multiple-use GPIO pins as a PWM pin.
Enable PWM and Set Properties
Enable PWM pin
P9_14 (PWM1A) and
set the frequency and duty cycle.
bbb = beaglebone(); enable(bbb, 'P9_14'); writePWMDutyCycle(bbb, 'P9_14', 0.5); writePWMFrequency(bbb, 'P9_14', 2000);
The result is a square wave with a 50.0% duty cycle, frequency
of 2000 hertz, and average voltage of
duty_cycle — Duty cycle of output waveform
Duty cycle between
assign to output pin.
Introduced in R2015a