- Hands-On Robotics Programming with C++
- Dinesh Tavasalkar
- 416字
- 2021-06-24 15:30:30
Installing the wiringPi library in the Raspberry Pi
wiringPi is a pin-based GPIO access library that is written in C. Using this library, you can control the Raspberry Pi using C/C++ programming. The wiringPi library is easy to set up. Once installed, the Raspberry Pi GPIO pins will have wiringPi pin numbering. Let's take a look at how to download and install wiringPi:
- First, open the Terminal window by clicking on its icon from the taskbar:

- Before installing the wiringPi library, we first need to verify that our Raspberry Pi is up to date by checking for updates. If your Raspberry Pi is not updated, you may face errors while installing the wiringPi library. To update your Raspberry Pi, type the following command:
$ sudo apt-get update
The output of the preceding command can be seen as follows:

- After the update, type in the following command to upgrade the Raspberry Pi:
$ sudo apt-get upgrade
While upgrading, you may get a message asking you to download a particular component. Type Y and then press Enter. It will take around 30-40 minutes for the upgrade to complete. Once the upgrade is done, you will see the following message:

- After updating your Raspberry Pi, you will need to download and install git-core inside your Raspberry Pi. To install Git, type the following command:
$ sudo apt-get install git-core

- After this, to download the wiringPi library from git, type in the following command:
git clone git://git.drogon.net/wiringPi

- Now, if you click on the File Manager option and click on the pi folder, you should see the wiringPi folder:

- Next, change the directory to wiringPi, so that the wiringPi files are downloaded and installed inside this particular folder. The command for changing the directory is cd:
$ cd ~/wiringPi (The ~ symbol is above the Tab key and it points to pi directory)

You should now see the directory pointing toward the wiringPi folder.
- Next, to fetch the Git files from their origin directory, type in the following command:
$ git pull origin

- Finally, for building the files, type in the following command:
$ ./build

Once everything is done, you will see an All done message:

Now that we have installed the wiringPi library, we can move on and understand wiringPi pin configurations on the RPi.
- 基于粒計算模型的圖像處理
- Python機器學(xué)習(xí):數(shù)據(jù)分析與評分卡建模(微課版)
- Learning Docker
- Java編程指南:基礎(chǔ)知識、類庫應(yīng)用及案例設(shè)計
- Scratch 3游戲與人工智能編程完全自學(xué)教程
- PostgreSQL 11從入門到精通(視頻教學(xué)版)
- 軟件測試技術(shù)指南
- Mastering Business Intelligence with MicroStrategy
- Creating Data Stories with Tableau Public
- App Inventor少兒趣味編程動手做
- Java 9 Programming By Example
- Modernizing Legacy Applications in PHP
- Learning Concurrency in Python
- Python應(yīng)用與實戰(zhàn)
- Java 7 Concurrency Cookbook