Introduction to Raspberry Pi 3B+ (2)

table of Contents

1 Pin correspondence

2 wiringpi库

2.1 Get the source code of wiringPi

2.2 Install wiringPi library

2.3 Test whether wiringPi is installed successfully

3 RPI.GPIO


1 Pin correspondence

There are three pin numbering methods for Raspberry Pi:

1. Number according to the physical position of the pin;

2. The number assigned by the C language GPIO library wiringPi;

3. The number assigned by BCM2837 SOC.

T-type expansion board adopts BCM coding.


2 wiringpi库

To use C/C++ programming, you need to install the wiringPi library.

Enter the Raspberry Pi desktop through VNC-View and open the command input window:

2.1 Get the source code of wiringPi

Remarks:

git clone git://git.drogon.net/wiringPi (may not be used)

2.2 Install wiringPi library

cd wiringPi

git pull origin

./build

 

2.3 Test whether wiringPi is installed successfully

Enter gpio -v

Enter gpio readall

 

3 RPI.GPIO

Introduction to RPI.GPIO

If you are a Python user, you can use the API provided by RPI.GPIO to program the GPIO. RPI.GPIO is a module that controls the Raspberry Pi GPIO channel. RPI.GPIO is installed by default in the Raspbian OS image of Raspberry Pi and can be used directly.

To learn how to install the python-dev package, enter:

sudo apt-get install python-dev

 

 

 

Guess you like

Origin blog.csdn.net/weixin_44643510/article/details/114090733