Thank you that helped, also that has sorted the error. But when I flashed it to the arduino it lit every led one by one. Then that was it, nothing is lit. I don't get it, this is the problem I have been having a lot. I'm pretty sure everything is connected correctly.
/*
Adafruit Arduino - Lesson 4. 8 LEDs and a Shift Register
*/
int latchPin = 5;
int clockPin = 6;
int dataPin = 4;
byte leds = 0;
void setup()
{
pinMode(latchPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(clockPin, OUTPUT);
}
void loop()
{
leds = 0;
updateShiftRegister();
delay(500);
bitSet(leds, 1);
updateShiftRegister();
delay(500);
}
void updateShiftRegister()
{
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, LSBFIRST, leds);
digitalWrite(latchPin, HIGH);
}