vendredi 5 avril 2013

WiringPi for the Raspberry Pi

Décembre 2018: Mes articles sur ce site date de 2013!
Je les ai tout de même laissés, ils ont peut-être encore une utilité.

Il vaut mieux consulter ce site: http://Mon livre sur Java, Python et le Raspberry Pi 3

Using WiringPi for verifying our relay

The small complete project described in


could use the WiringPi package for testing the relay.

The WiringPi is a library part of the Gordons projects described in

The installation

In case our Raspberry Pi software is not up-to-date, it's better to do:

sudo apt-get update
sudo apt-get upgrade

The git sotfware is a revision control and source code management which may need tp be installed on the Raspberry: 

sudo apt-get install git-core

The Drogon projects has a repository for WiringPi which can be downloaded and installed:

git clone git://

Then, when done, we can see that the directory /home/pi/wiringPi has been created
and we should built it:

cd wiringPi

The WiringPi is coming with a C/C++ library and some examples. The gpio utility is also provided in order to run GPIO command directly from a terminal.

Testing our relay

As explained in the relay is connected on the GPIO 14 and the gpio following command can be used to deactivate or activate the relay:

gpio -g mode 14 out
gpio -g write 14 0
gpio -g write 14 1

The parameter -g indicates that the pin numbers are interpreted as BCM_GPIO pin numbers rather than standard pin numbers.

Aucun commentaire:

Enregistrer un commentaire