Raspberry Pi GPIO connections.

WiringPi Blink an LED Demo

by Lewis Loflin

See YouTube video Raspberry Pi Blink Demo.

This video introduces one to using Geany for Raspberry Pi and using it for programming WiriingPi an Arduino like C library to control the RPi GPIO. See Using Geany Text editor C Programming. For more on Geany see http://www.geany.org/Main/HomePage.

WiringPi allows one use Arduino type programming with the Raspberry Pi GPIO. Here I'll explore how this is used and how it differs from Arduino.

I'll connect Raspberry Pi to a LED which will blink.

WiringPi comes native to the newest version of Rasbian. One must be root to use.

Under root create a folder: "mkdir /root/work" and put your programs in there when being compiled.

Under Geany notice an arrow next to "Build" and open a drop down menu go down to command options or whatever. Under build in the box add "-lwiringPi" at the end.

This is written in C and has to be compiled. I suggest using Geany under Linux.

Get it "sudo apt-get install geany-plugins".

WiringPi was developed by Gordon Henderson.

WiringPi homepage http://wiringpi.com/

#include <wiringPi.h>
#include <stdlib.h>
#include <stdio.h>

#define ledPin 25
// P0-P7 is 0-7 works through pins 29
// see pin connections

int main() {
  printf ("Raspberry Pi - blink LED \n") ;
  if (wiringPiSetup () == -1)
    exit (1) ;
  pinMode(ledPin, OUTPUT);
  while (1) {
    digitalWrite(ledPin, 0);
    digitalWrite(ledPin, 1);

  return 0 ;


YouTube Videos:
MCP4725 12-Bit DAC Interface to Raspberry Pi
ADS1115 4-Channel ADC Uses I2C with Raspberry Pi
Interface I2C LCD to Raspberry Pi in C
Pulse-Width-Modulation with Raspberry Pi
Using Geany Text editor C Programming
Raspberry Pi Blink Demo
MAX6675 Raspberry Pi Demo

Raspberry Pi, Arduino, and Learning Linux
Raspberry PI Arduino Advanced Interface
Tkinter with Raspberry Pi and PCF8591 AD-DA Sensor

Linux Videos

Live Linux Distro for Using Printer Port with Electronics
Using the powerful Rox-Filer system in Linux
Use FEH under Linux for a Wallpaper Setter
How to create Symbolic links in Linux