Raspberry Pi Knight Rider LEDs Part 1

This is the first part of a two parter on creating the K.I.T.T. light bar with LEDs using your Pi (I know, awesome, right?).

Here’s mine in action:

In this section we’ll install the wiringPi library on the Raspberry Pi, connect up a single LED, and write a simple program in C to make it flash.

In part two we’ll connect up more LEDs, expand the code, and then travel back to the 80s with our finished product.

Read More »



Headless Boot Of Raspberry Pi Using A Static IP Address

(Looking for headless boot using DHCP?)

If you don’t have a DHCP server running on your home network, or you want to allocate a specific ip address for your Pi – maybe because you want to access it via a second network port on a local machine, or via a standard hub – you can still headless boot by setting the ip address on the SD card beforehand.

You will need:

  1. A computer running Linux (mine is Fedora 20).
  2. A Raspberry Pi and compatible power adapter.
  3. An ethernet cable.
  4. An SD card for the Pi OS

Read More »



Headless Boot Of Raspberry Pi Using DHCP

I’ve been meaning to do something with this amazing little machine for a long time. It really appeals to me because you can use it just like an embedded target device – in other words, you can do embedded programming at home for very little cost.

This tutorial walks you through the set-up of your Pi without all those pesky peripherals, like a keyboard and monitor.

This is known as a headless boot, and it’s a basic embedded technique for dealing with target devices.

Read More »



The extern Keyword

After all the recent posts about statics, I wanted to talk about the extern keyword before moving onto something different.

Do you remember the problem we had with our “global” static variable in this post? If you haven’t read it, the code example illustrated that static variables are only available to code in the translation unit. That means that if you include a file with a static variable in several of your other files, you won’t just have one copy of that variable. This is really important, because you could run into a nasty bug if you are accessing the static variable thinking that it is the same one across all the files you are using it in.

The extern keyword provides the solution to this, as it allows you to create a true global variable that will be available across all files and all translation units.

Read More »