Installing WiringPi (and pin allocation) – Raspberry Pi

WiringPi is a library that is used by many applications on the Raspberry but is not available by default. Especially many examples from the Arduino (C ++ code) can be performed easily on the RaspberryPi. To do so, this valuable library was written.

 

Install

Your PI should be up-to-date, therefore:
sudo apt-get update && sudo apt-get upgrade

Now we need git:

sudo apt-get install git git-core

Now we need git: Now WiringPi can be downloaded and installed:

git clone git://git.drogon.net/wiringPi
cd wiringPi
./build
That’s it. To later upgrade to a newer version you can type the following command in that folder:
git pull origin
./build

and the latest version is installed.

 

Pin allocation

The pin assignment of wiringPi is not the same as that of the GPIOs.

To get information about your Raspberry Pi you can enter this command:

gpio -v

The easiest way to output the pin allocation is typing

gpio readall

because it is different on the various models.

 

Here the pin assignment for Rev. 1 and Rev. 2:

pinbelegung-wiringpi

4 Responses

  1. Every time I enter “git clone git://git.drogon.net/wiringPi” into the Pi, it just error codes. I’m on a Pi 3 model B if that factors into the access somehow. Any idea why that may be happening?

    Reply
    • I am having the same problem, im a newb like a full linux/unix newb so all this sudo bla bla and stuff i have no clue, so little more help from new pi 3b with noobs default os python2 and 3 are installed, i did manage to some how got pycharm installed but all them i have no clue, when say run sample, how? do i just use terminal window or do i use pyhton3 to do all the installing and stuff, i have spi and headless and stuff setup in the rasp-config, i have 1 red 8×8 MAX7219 matrix display with driver board and i want to run a marquee or kinda message or simple pictures or both, when i did a pi reboot it light up all lights on the matrix thats all and that was few secs after applying power but im newb so i needs help please!

      Reply
    • I’m having the same problem. When I type it clone git://git.drogon.net/wiringPi”
      fatal: unable to connect to git.drogon.net ….. connection refuse.

      Reply

Leave a Comment

Your email address will not be published.

Subscribe to Raspberry Pi Tutorials and don't miss any new Tutorial!