Accessing Raspberry Pi GPIO pins via wiringPi

Since we have installed wiringPi, we can now look at the wiringPi pin numbering, as shown in the following screenshot:

The Physical column represents the Raspberry Pi numbering from 1-40. On both sides of the Physical column, you will see the wiringPi (wPi) columns. The arrows pointing from the Physical column to wPi represent the wiringPi pin numbering for a particular physical pin of a Raspberry Pi.

Take a look at the following examples:

By consulting this table, you can figure out which of the remaining physical pins correspond to which wiringPi pins.

wiringPi pin numbers from 17-20 do not exist. After wPi pin 16, we skip straight to wPi pin 21.

To better understand the relationship between the wiringPi pins and the physical pins, you can refer to the following diagram: 

The wiringPi pin numbering is what you will need to remember while programming. We can use a total of 28 wiringPi pins for programming. As well as these, we have the following pins, which can be used for providing power and can be used as ground pins:

Let's move on to writing our first C++ program for Raspberry Pi.