Raspberry PI GPIO Programming in C | Wiring PI Tutorial Reviewed by Momizat on . This tutorial will guide you to control gpio of raspberry pi using c programming language, with the help of wiring PI library. Schematic Diagram: Connect One le This tutorial will guide you to control gpio of raspberry pi using c programming language, with the help of wiring PI library. Schematic Diagram: Connect One le Rating: 0
You Are Here: Home » Tutorial » Raspberry PI GPIO Programming in C | Wiring PI Tutorial

Raspberry PI GPIO Programming in C | Wiring PI Tutorial





This tutorial will guide you to control gpio of raspberry pi using c programming language, with the help of wiring PI library.

Schematic Diagram:

Connect One led to GPIO 0 , i.e. Physical Pin 11 of raspberry pi using jumper wire.

Raspberry PI | LED

———————————–

PIN 11 ——-> LED Cathode

3.3V¬† ——–> LED Anode

If you are not sure, which pin is your GPIO follow this screen shot, You can get this using following command.

Command to check Pin Out:

(this command can be run only after you install the wiringPI library.)

raspbery-pi-gpio-pinout-read-all-wiring-pi
Step 1: Install Git core
Git is code repositroy system, where you can store and make version of code online. To use GIT
you have to install Git core in your raspberry pi.

Command To install GIT Core.

sudo apt-get install git-core

Step 2: Download code from git branch,

Once the GIT core is installed, you have to install it download the wiringPI library from git branch.

Command to download wiringPI library:
git clone git://git.drogon.net/wiringPi

Step 3: Build and install wiring pi library

Once downloaded, go to directory
cd wiringPi

Then run below command.
./build

Step 4: Write your code.
Open your text editor, Nano in my case, copy following code to your editor.

Step 4: Save , Exit, Compile and Run

Command to compile

after successful compilation run the executable.

 

Video Guide of Above Tutorial:

About The Author

I am a maker, who loves to think, hack and build new electronics stuff, I always find time to document , share my knowledge with others. I am graduate in BTech(Electronics and Communication Engineering).

Number of Entries : 39
Scroll to top