
37Chapter2: Two Degrees of Freedom
create a truly random number. Creating a near-
random number, however, is much easier. When
the Arduino begins its algorithm for generating a
pseudorandom number, there is always a number
that serves as an input to the algorithm. The
randomSeed() command defines that starting
input number. In our case, we are using the
voltage from analog pin A0. Because we don’t
have a device such as a potentiometer plugged in,
nothing is connected, and that pin is considered
to be floating. A floating pin will often have wildly
fluctuating values, which serve as the input for
our random number algorithm, meaning our
numbers ...