Check this arduino reference
http://www.arduino.cc/en/Tutorial/ShiftOut
the anode to the 5V output and the cathode to data pins in the shift register (pins 15, 1-7)
to turn on all LEDs with common anode you send shiftOut(dataPin, clockPin, MSBFIRST, B00000000);
to turn off shiftOut(dataPin, clockPin, MSBFIRST, B11111111);
if you want sequences then use some arrays, i have 3 arrays (1 for each color) and 3 shift registers chained
a simple code to test random colors
int latchPin = 8; // shift register pin 12
int clockPin = 12; // shift register pin 11
int dataPin = 11; // shift register pin 14
int Power = 3; // to common anode in RGB LEDs to control brightness
void setup() {
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(Power, OUTPUT);
}
void loop() {
int brightness = random (256) ;
int red = random (256);
int green = random (256);
int blue = random (256);
for (int i = 0; i < 20; i++){
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, blue);
shiftOut(dataPin, clockPin, MSBFIRST, green);
shiftOut(dataPin, clockPin, MSBFIRST, red);
digitalWrite(latchPin, HIGH);
analogWrite(Power, brightness);
delay(180); // milliseconds
}
}
and a image, with this arrange i can control individually each LED and each color