user31105: I have a problem with the shift register 74HC595. 
The sketch I use is able to enable a specific led (8 are connected).
When I enable led 0 to 7 it behaves like normally (they switch on when I enter the numbers).
However, for the led connected to pin 15 (other side of the ic, see layout) it behaves differently.
 When I switch this led on, ALL leds go off. When I retry, nothing happens. When I enable another led, after a short time (but can be seconds) the led for pin 15 is emitting light together with all others which where already enabled.
This seems like a malfunction in the IC (I checked already another led, another cable, another resistor). The only think I haven't checked is moving the IC to another position of the breadboard (that would take a lot of time since I have to rewrite everything). Is it possible I missed something or is the shift register broken?
The code to switch on a led:
void updateShiftRegister()
{
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, LSBFIRST, leds);
  digitalWrite(latchPin, HIGH);
}

where leds are the indices of the leds (0..7).

user31043: You cannot directly give an index (0..7) to a shift register if you want the index to represent the LED number to be switched on.
You have to build a table similar to the following:
byte led[8] = {
0b00000001,
0b00000010,
0b00000100,
0b00001000,
0b00010000,
0b00100000,
0b01000000,
0b10000000
};

and later . . .
shiftOut(dataPin, clockPin, LSBFIRST, led[leds]);

where leds is a number 0..7

31105: <p>I have a problem with the shift register 74HC595. </p>

<p>The sketch I use is able to enable a specific led (8 are connected).</p>

<p>When I enable led 0 to 7 it behaves like normally (they switch on when I enter the numbers).</p>

<p>However, for the led connected to pin 15 (other side of the ic, see <a href="http://2.bp.blogspot.com/-cIb_uYGrRk4/U1fxdfGhy-I/AAAAAAAAADg/kcuUjMcpzD0/s1600/Region+Capture.png" rel="nofollow noreferrer">layout</a>) it behaves differently.
 When I switch this led on, ALL leds go off. When I retry, nothing happens. When I enable another led, after a short time (but can be seconds) the led for pin 15 is emitting light together with all others which where already enabled.</p>

<p>This seems like a malfunction in the IC (I checked already another led, another cable, another resistor). The only think I haven't checked is moving the IC to another position of the breadboard (that would take a lot of time since I have to rewrite everything). Is it possible I missed something or is the shift register broken?</p>

<p>The code to switch on a led:</p>

<pre><code>void updateShiftRegister()
{
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, LSBFIRST, leds);
  digitalWrite(latchPin, HIGH);
}
</code></pre>

<p>where leds are the indices of the leds (0..7).</p>
 31043: <p>You cannot directly give an index (0..7) to a shift register if you want the index to represent the LED number to be switched on.
You have to build a table similar to the following:</p>

<pre><code>byte led[8] = {
0b00000001,
0b00000010,
0b00000100,
0b00001000,
0b00010000,
0b00100000,
0b01000000,
0b10000000
};
</code></pre>

<p>and later . . .</p>

<pre><code>shiftOut(dataPin, clockPin, LSBFIRST, led[leds]);
</code></pre>

<p>where leds is a number 0..7</p>
