How to use two 74HC595n shift register to random 16 LEDs

What is the code that use two 74HC595n shift register to random 16 LEDs?
Here is how I connect

thank for your help

henryfung1515:
What is the code that use two 74HC595n shift register to random 16 LEDs?

What's the code that you have tried.

Change the connections a little:
D13 to SRCK on both devices.
D11 to Serial data in, daisy chain to 2nd shift register.
D10 to RCLK on both devices. (byte ssPin = 10;)
OE to GND on both devices
SRCLR to +5 on both devices
0.1uF (100nF) cap from VCC on both devices to Gnd.
Then:

digitalWrite (ssPin, LOW);
SPI.transfer(byte0);
SPI.transfer(byte1);
digitalWrite (ssPin, HIGH); // outputs update on this rising edge

and create byte0, byte1 however you are creating/updating them.

Oh, and
#include (SPI.h>
at the top of your sketch, or use File:Import Library to bring it in.
And put these
SPI.begin();
pinMode (ssPin, OUTPUT);
in setup()