IN THIS CHAPTER
Learning what GPIO pins you can use
Seeing how you can control GPIO pins in Scratch and Python
Making a GPIO pin flash an LED and read a push button
Building a working electronic dice display
Building a working model of a pedestrian crossing
Chapter 15 tells you all about what GPIO pins are, but in this chapter we want to describe how to access them physically and how to control them with software. We use both Scratch and Python to do this, but ultimately Python is the much more capable language for input/output control.
The GPIO pins are the key to enabling the Raspberry Pi to take control of any external circuit. They can be used as an output to switch on an LED or as an input to sense the state of an external push button. These connections into the computer, along with the fixed voltage power pins, are on a dual-row, 40-pin header plug. There are many ways to physically access ...