Pulse-width modulation (PWM) is a powerful technique for controlling analog circuits with a microcontroller's digital outputs. PWM is used in many applications, ranging from communications to power control and conversion. For example, the PWM is commonly used to control the speed of electric motors, the brightness of lights.