Pulse-width modulation is a technique that allows a microcontroller to control the speed of motors, brightness of LEDs, or average voltage without needing a DAC.
If you don't have a microcontroller with on-board PWM hardware, or have run out of PWM channels, how can PWM be simulated using software?