There's a good tutorial with code examples for the shift register here:http://arduino.cc/en/Tutorial/ShiftOut