Hi to everyone.

I want to drive a 10 led bar like this one:

I want it to show the value of a potentiometer: 1 led at minimun, and 10 leds at maximum.

With only one 595 it works great, but I can only acces 8 leds, so I added a second 595.

I've wired just like this: But using only two leds on the second register, leaving unconnected the other pins.

I don't know if I a have a problem in my circuit/code or in how I think this should work...

I understand that if I send an 8 bit number, it will appear in the first register

And if I send a bigger number, like 10 bits, the first 8 will appear on the first register, and the other 2 bits will appear on the second register. Is this right?

But what I see in the second register its an exact copy of the first register. When the bit 0 goes HIGH in the first reg, the same happens on the second reg, and so with the other bits

Whats wrong?

Thankss!

```
const int latchPin = 8;
const int clockPin = 12;
const int dataPin = 11;
void setup() {
pinMode(latchPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(clockPin, OUTPUT);
digitalWrite(latchPin, HIGH);
}
void loop()
{
int value=segmentosPotes();
digitalWrite(latchPin, LOW) ;
delay(5);
shiftOut(dataPin, clockPin, MSBFIRST, value);
digitalWrite(latchPin, HIGH) ;
}
int segmentosPotes()
{
int num = map(analogRead(A0), 0, 1023, 1, 10);
switch (num)
{
case 1: return 1; //turns on bit 0
case 2: return 3; //turns on bit 0 and 1
case 3: return 7; //turns on bit 0, 1 and 2
case 4: return 15; //etc
case 5: return 31;
case 6: return 63;
case 7: return 127;
case 8: return 255;
case 9: return 511;
case 10: return 1023;
}
}
```