8/Analog Input
and Output
In Chapter 6, you learned about digital in-
puts and outputs with buttons, switches,
LEDs, and relays. Each of these compo-
nents was always either on or off, never
anything in between. However, you might
want to sense things in the world that are
not necessarily one or the other—for in-
stance, temperature, distance, light levels,
or the status of a dial. These all come in
a range of values.
Or you may want to put something in a state that’s not just on or
off. For example, suppose you wanted to dim an LED or control the
speed of a motor, rather than just turning it on or off. To make an
analogy for analog and digital, you can think of a typical light switch
versus a dimmer switch, as ...