Page 104 - Programming the Raspberry Pi Getting Started with Python
P. 104
Figure 10-3 Adding a button to the design
NOTE Shut down and power off your Pi before you start making changes on the breadboard.
The button has four leads and must be placed in the right position; otherwise, the switch will appear
to be closed all the time. The leads should emerge from the sides facing the top and bottom of Figure
10-3. Don’t worry if you have the switch positioned in the wrong way—it will not damage anything,
but the display will continuously change mode without the button being pressed.
Two new wires are needed to connect the switch. One goes from one lead of the switch (refer to
Figure 10-3) to the GND connection of the display. The other lead goes to the connection labeled #17
on the Cobbler. The effect is that whenever the button on the switch is pressed, the Raspberry Pi’s
GPIO 17 pin will be connected to ground.
You can find the updated software in the file 10_02_fancy_clock.py and listed here: