Hardware Reference
In-Depth Information
Discussion
The code uses
setInterval()
to call
fade()
regularly. When called,
fade()
will
increase the brightness by
step
. Note that, if
step
is negative, the LED will actually be-
come dimmer. If brightness is outside the
min
-
max
bounds, the
step
direction is
changed.
You will need to press ^C (Ctrl-C) to quit the script.
NOTE
You cannot use every pin for analog writes; only those that support PWM will work. Point
your browser to
the Headers page served by your Bone
and scroll down to the PWM page to
see which pins work. The table is reproduced in
Figure 3-5
.