Wiringpi is suitable for people with C language basics who have already been in touch with MCU or embedded development before being in touch with Raspberry Pi. The API functions of wiringpi are very similar to those of Arduino, which makes it popular. The author provides a lot of instructions and sample code, including UART devices, I2C devices, and SPI devices. Without a doubt, wiringpi is very powerful.
The first thing to do is install wiringpi. Wiringpi uses the GIT tool to maintain an update code.
If you have not installed the GIT tool on your platform, enter the following command:
Sudo apt-Get install Git-core
If an error occurs during this process, update the software. For example, enter the following command:
Sudo apt-Get update
Sudo apt-Get upgrade
Then you can use git to obtain the source code of wiringpi.
Git clone git: // git.drogon.net/wiringpi
If you want to update wiringpi.
CD wiringpi
Git pull Origin
Go to the wiringpi directory and install wiringpi
CD wiringpi
./Build
The build script will help you compile and install wiringpi.
Test whether wiringpi is successfully installed.
Wiringpi includes a set of gpio commands. The gpio command can be used to control various interfaces on Raspberry Pi. The following command can be used to test whether wiringpi is successfully installed.
Gpio-V
Gpio readall
Gpio pin description
It is the description of the wiringpi pin, which must be described here. First, Raspberry Pi has versions A and B, and versions A and B have different gpio pins. Second, wiringpi re-encapsulates Raspberry Pi pins, for example, the gpio0 of wiringpi indicates the gpio17 of bcm2835. This is only an encapsulation ing relation and will not have a great impact on development and use.
The hardware circuit connection is as follows:
The procedure is as follows:
This experiment is to make the LED flash and write the application in VIM:
Then compile and execute the program and print it in the terminal.
The first LED lights up, and the next learning will turn on.
Qubishi Raspberry Pi gpio