Writes average PWM voltage to PWM pin
the average voltage of the output square wave to the output pin. This
implicitly writes the duty cycle of the output square wave. The output
square wave voltage is
3.3 V maximum and
The BeagleBone Black board has eight PWM output pins. Each PWM pin outputs a square waveform with variable frequency and duty cycle.
Enable PWM pin
P9_14 (PWM1A) and
set the frequency and average voltage.
bbb = beaglebone(); enable(bbb, 'P9_14'); writePWMFrequency(bbb, 'P9_14', 2000); writePWMVoltage(bbb, 'P9_14', 1.65);
The result is a square wave with a 50.0% duty cycle, frequency
of 2000 hertz, and average voltage of
voltage— Mean voltage of output waveform, in volts
Mean voltage of the square wave at the output pin, in volts.
The value is constrained between
0 V and
A value of
0 V produces no output. A value of
produces a square wave with a 50% duty cycle at the output pin.