Pulse Width Modulation (PWM) is a typical example of digital to analog conversion. By pulsing between 1 and 0 at different frequencies, a digital (binary) signal can mimic many different values. Arduino has a great
tutorial on PWM
. The wikipedia
page
is helpful but also TMI. The bottom line is PWM is a great way to output a smooth continuous signal on a wire that is actually only capable of outputting ones and zeros. Applications include fading an LED, mixing
colors on LEDs
, controlling
servo motors
, controlling the speed of DC motors,
like this pump
, or making different sounds on a piezo buzzer. Pulse width modulation is activated by the Arduino function
analogWrite
.