What the heck is a GPIO?

The key to the Pi seems to be the ability to control and manipulate the device, and get it to do things.  The key seems to be centered on these things called GPIO pins.

It seems that connecting wires to these pins and then connecting them to breadboards with wires allowed you to control many things.  Seems, I needed to learn a few things.


  1. GPIO General propose input and output pins.  Ok, interesting to know, so what.
  2. Breadboard, these are boards with holes in them, they are used for prototyping electronic projects.
  3. GPIO Breakout Board.  Well, this just happens to be the odd T shaped component that came with the kit.  This wonderful device connects the GPIO header on the mother board to the properly sized breadboard.  It allows you to connect wires and preform prototyping with he GPIO so much faster.
  4. How to interface with them?  Seems like the open source world has come to the rescue again, http://wiringpi.com. Not only did it contain command line utilities for interfacing with the GPIO pins, it also had libraries available from C and C++.  Score one for me!

So now armed with some documentation, I decided it was time to make use of a GPIO pin, and do the hardware equivalent of a hello world program, I was going to make a red led light blink.

Now, this is where I started to get lost, it seems there are 3 different numbering schemes for addressing the GPIO, and depending on how you interface with it depends on what numbering you use.

  1. Physical Pin
  2. BCM Pin Broadcom Pin Numbering.
  3. WiringPi for the wiringPi library.

So after reading I find that some function laity of the GPIO is restricted access, and in order to execute them you have to be root.  There is a way around this, it requires exporting pins.  At the time, this was far more complex then it seemed and I simple wanted to get this stupid red light to blink.  Knowing this, I simply used sudo where needed.

Now it was time for my lack of knowledge of GPIO as well as simple electronics to get the better of me.  Time to make the Red Light dance for me.



No comments:

Post a Comment