For reasons not completely known to myself, I bought a raspberry pi recently.  Here’s a first circuit, a collaboration between myself and Lance.  Lance added a switch between the GPIO output port and the LED, so that the port has to be enabled by both software, and by the physical switch

pi and the circuit

the circuit

I tried two different ways of controlling the GPIO, the first using a command line tool:

#!/bin/bash

# https://projects.drogon.net/raspberry-pi/gpio-examples/tux-crossing/gpio-examples-1-a-single-led/

gpio mode 0 out
gpio write 0 1
sleep 5
gpio write 0 0


and the second with a bit of python code:

#! /usr/bin/python
import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)

GPIO.output( 17, 1 ) ;
time.sleep( 5 ) ;
GPIO.output( 17, 0 ) ;