- Hands-On Robotics Programming with C++
- Dinesh Tavasalkar
- 305字
- 2021-06-24 15:30:30
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:
- Physical pin number 3 has a wiringPi pin number of 8
- Physical pin number 5 has a wiringPi pin number of 9
- Physical pin number 8 has a wiringPi pin number of 15
- Physical pin number 11 has a wiringPi pin number of 0
- Physical pin number 40 has a wiringPi pin number of 29
By consulting this table, you can figure out which of the remaining physical pins correspond to which wiringPi pins.
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:
- Physical pin numbers 6, 9, 14, 20, 25, 30, 34, and 39 are ground pins
- Physical pin numbers 2 and 4 provide a +5V supply
- Physical pin numbers 1 and 17 provide a +3.3V supply
Let's move on to writing our first C++ program for Raspberry Pi.
- 大話PLC(輕松動(dòng)漫版)
- 深入核心的敏捷開發(fā):ThoughtWorks五大關(guān)鍵實(shí)踐
- Computer Vision for the Web
- Java 9 Concurrency Cookbook(Second Edition)
- Linux核心技術(shù)從小白到大牛
- Java游戲服務(wù)器架構(gòu)實(shí)戰(zhàn)
- Python數(shù)據(jù)分析從0到1
- Building RESTful Python Web Services
- Fast Data Processing with Spark(Second Edition)
- Troubleshooting Citrix XenApp?
- Arduino可穿戴設(shè)備開發(fā)
- Mudbox 2013 Cookbook
- 基于GPU加速的計(jì)算機(jī)視覺編程:使用OpenCV和CUDA實(shí)時(shí)處理復(fù)雜圖像數(shù)據(jù)
- Functional Python Programming
- Applied Deep Learning with Python