Nothing much to say, really.  You set period (in ns), duty_cycle (in ns), and then enable it (which turns on). 

Eg. I can beep an mini-buzzer salvaged from old PC at 500Hz.
cd /dev/bone/pwm/1/a
echo $((2*1000*1000)) > period            # 2ms
echo $((1*1000*1000)) > duty_cycle        # 50%
echo 1 > enable
To turn if off,
echo 0 > enable
Eg. Driving LED with it, I can see LED get brighter or dimmer, by changing duty_cycle.


On 2025-12-10 01:22, Steve Litt via Talk wrote:
William Park via Talk said on Tue, 9 Dec 2025 21:27:32 -0500


 * PWM (pulse width modulation) -- eg. turning on buzzer
Please tell us more about PWM. That can be used for almost lossless
voltage control, speed control, and a whole lot more.

Thanks,

SteveT

Steve Litt 

http://444domains.com

------------------------------------
Description: GTALUG Talk
Unsubscribe via Talk-unsubscribe@lists.gtalug.org
Start a new thread: talk@lists.gtalug.org
This message archived at https://lists.gtalug.org/archives/list/talk@lists.gtalug.org/message/5QT2TTJ5XDJ43LRHN4VNONHZWTZVLHN3/