Getting at the GPIO Pins
GPIO connections are the way for the outside world to get into your Raspberry Pi. In this chapter, we concentrate on using them for inputs only. In Chapter 16, we cover using them for outputs as well. Most of the GPIO lines on the Raspberry Pi power up as floating inputs. That means inputs not connected to anything else; in other words, they are high-impedance inputs. The exceptions are GPIO pins 14 and 15. These are used on boot-up for outputting data to a serial terminal. Notwithstanding this, these pins can simply be changed back into an input.
The bulk of the free GPIO pins appear on one connector — the double row connector along the top-left edge of the board (assuming you hold it so the writing is the right way up). It’s called P1, which stands for plug one. It’s a plug because it has male connections. Female connections are called sockets and there are a few of those on the board as well.
Two ways exist of numbering the pins on a component in electronics. One way is to start at one corner and number the pins in an anti-clockwise direction all the way round. This is universally done with integrated circuits (ICs). The other way of numbering pins is to have them alternating from side to side, so that one side has all the odd number pins and the other all the even numbers. This is done mainly with plugs and sockets, especially those with two rows. This is the case with P1 on the Raspberry Pi: It has a row of odd-numbered pins and row of even-numbered ...