How to program daisy chained 595 shift register ?

hello everyone,
I am trying to program 2 shift registers 595 daisy chained together what i am trying to do exactly is turning a potentiometer which will lead to rpm LEDs being light up but I don't won't the leds connected to the daisy chained register to light up with the first register leds, so the RPM leds are on the first shift register and second shift register is for turning leds on and off independently. So I need your help please to understand how to make this ?

attached is my circuit without the LEDs there was no space and please ignore the fact that +5 is missing all in reality are connected I just wanted to show how I connected my ICs together

my sketch is :

//Steering potentiometers
const byte Throttle = A4;

// Define arduino pins for the 74HC595 shift register
int dataPin_595 = 4;
int clockPin_595 = 2;
int latchPin_595 = 3;

void setup() {
  Serial.begin(9600);

  // define arduino pins used to connect to the 595 shift register
  pinMode(dataPin_595, OUTPUT);
  pinMode(latchPin_595, OUTPUT);
  pinMode(clockPin_595, OUTPUT);

  
}

void loop() {
 
  int ThrottleValue = analogRead(Throttle);  // read the value from the sensor
  //ThrottleValue =  map(ThrottleValue, 0, 1023, 255, 0); //middle throttle value 121
  Serial.println(ThrottleValue);

  int numLEDSLit = ThrottleValue / 146 + 1; //1023 / 9
  int leds = 0;

  for (int i = 0; i < numLEDSLit; i++)
  {
    bitSet(leds, i);
  }
  
  digitalWrite(latchPin_595, LOW);
  // shift out the bits:
  shiftOut(dataPin_595, clockPin_595, MSBFIRST, leds);
  //shiftOut(dataPin_595, clockPin_595, LSBFIRST, leds); 
  //take the latch pin high so the LEDs will light up:
  digitalWrite(latchPin_595, HIGH);
}

If you want to independently control the two groups of 8 LEDs on 2 daisy chained SRs then you need to either set the bits of a 16 bit int variable appropriately then shift all 16 bits into the first SR or use 2 separate bytes, one for each 8 LED group and shift the 2 bytes out one after the other

UKHeliBob:
If you want to independently control the two groups of 8 LEDs on 2 daisy chained SRs then you need to either set the bits of a 16 bit int variable appropriately then shift all 16 bits into the first SR or use 2 separate bytes, one for each 8 LED group and shift the 2 bytes out one after the other

ok how can i do that ? is it like the below ?

void loop() {
 
  int ThrottleValue = analogRead(Throttle);  // read the value from the sensor
  //ThrottleValue =  map(ThrottleValue, 0, 1023, 255, 0); //middle throttle value 121
  Serial.println(ThrottleValue);

  int numLEDSLit = ThrottleValue / 146 + 1; //1023 / 9
  int leds = 0;
  int leds2 = 1;
  
  for (int i = 0; i < numLEDSLit; i++)
  {
    bitSet(leds, i);
    bitSet(leds2, i);
  }
 
  digitalWrite(latchPin_595, LOW);
  // shift out the bits:
  shiftOut(dataPin_595, clockPin_595, MSBFIRST, leds);
  shiftOut(dataPin_595, clockPin_595, MSBFIRST, leds2);
  //take the latch pin high so the LEDs will light up:
  digitalWrite(latchPin_595, HIGH);
}

SOLUTION

by setting leds2 we change the LEDs on the daisy chained register from on to off and so on

void loop() {
 
  int ThrottleValue = analogRead(Throttle);  // read the value from the sensor
  //ThrottleValue =  map(ThrottleValue, 0, 1023, 255, 0); //middle throttle value 121
  Serial.println(ThrottleValue);

  int numLEDSLit = ThrottleValue / 146 ; //1023 / 9
  int leds = 0;
  int leds2 = 2;
  
  for (int i = 0; i < numLEDSLit; i++)
  {
    bitSet(leds, i);
  }
 
  digitalWrite(latchPin_595, LOW);
  // shift out the bits:
  shiftOut(dataPin_595, clockPin_595, MSBFIRST, leds2);
  shiftOut(dataPin_595, clockPin_595, MSBFIRST, leds);
  //take the latch pin high so the LEDs will light up:
  digitalWrite(latchPin_595, HIGH);
}

Connect RCLK of register of the first to SER of the second chip. Try this link for pin info etc. http://www.ti.com/lit/ds/symlink/sn74hc595.pdf Try this link it has a good description. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil