
Figure 7-1.
Using a text editor and LXTerminal to edit and launch
Python scripts.
Try modifying the script to make the LED blink faster by using dec-
imals in the time.sleep() functions. You can also try adding a few
more LEDs and getting them to blink in a pattern. You can use any
of the dedicated GPIO pins that are shown in Figure 6-2.
Reading a Button
If you want something to happen when you press a button, one way
to do that is to use a technique called
polling
. Polling means contin-
ually checking over and over again for some condition. In this case,
your program will be polling whether the button is connecting the
input pin to 3.3V or to gr ...