Thank you Matallor, a very good explanation for which I am very grateful. It makes perfect sense when I look at the code now, but as a beginner there is so many possible sources of malfunction it is hard to spot them.
I rewired and added another 74HC595 in daisy chain to see what happened, but it was not what I had hoped. I was hoping the first on would accept the first 8 bits and then just bypass the rest, but instead it copies the results on the first to the second with a small delay.
// Declaring input pins
byte inPin0 = A0; // pushbutton connected to analog pin A0
byte inPin1 = A1; // pushbutton connected to analog pin A1
byte inPin2 = A2; // pushbutton connected to analog pin A2
byte inPin3 = A3; // pushbutton connected to analog pin A3
byte inPin4 = A4; // pushbutton connected to analog pin A4
byte inPin5 = A5; // pushbutton connected to analog pin A5
byte inPin6 = 5; // pushbutton connected to digital pin 5
byte inPin7 = 6; // pushbutton connected to digital pin 6
byte inPin8 = 7; // pushbutton connected to digital pin 7
byte inPin9 = 8; // pushbutton connected to digital pin 8
byte inPin10 = 9; // pushbutton connected to digital pin 9
byte inPin11 = 10; // pushbutton connected to digital pin 10
byte inPin12 = 11; // pushbutton connected to digital pin 11
byte inPin13 = 12; // pushbutton connected to digital pin 12
byte inPin14 = 13; // pushbutton connected to digital pin 13
// Declaring output pins
int latchPin = 3; //Pin connected to ST_CP(pin 12) of 74HC595
int clockPin = 2; //Pin connected to SH_CP(pin 11) of 74HC595
int dataPin = 4; //Pin connected to DS(pin 14) of 74HC595
// Declaring the bitsToSend variable which specifies the bit
// correlating to the specific output pin on the 74HC595
byte bitsToSend;
void setup() {
// Declare the chosen input pins to act as inputs
pinMode(inPin0, INPUT); // sets the analog pin A0 as input
pinMode(inPin1, INPUT); // sets the analog pin A1 as input
pinMode(inPin2, INPUT); // sets the analog pin A2 as input
pinMode(inPin3, INPUT); // sets the analog pin A3 as input
pinMode(inPin4, INPUT); // sets the analog pin A4 as input
pinMode(inPin5, INPUT); // sets the analog pin A5 as input
pinMode(inPin6, INPUT); // sets the digital pin 5 as input
pinMode(inPin7, INPUT); // sets the digital pin 6 as input
pinMode(inPin8, INPUT); // sets the digital pin 7 as input
pinMode(inPin9, INPUT); // sets the digital pin 8 as input
pinMode(inPin10, INPUT); // sets the digital pin 9 as input
pinMode(inPin11, INPUT); // sets the digital pin 10 as input
pinMode(inPin12, INPUT); // sets the digital pin 11 as input
pinMode(inPin13, INPUT); // sets the digital pin 12 as input
pinMode(inPin14, INPUT); // sets the digital pin 13 as input
// Declare Arduino board output pins to 74HC595 input pins:
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}
void loop() {
// Read the inputs and collects the values to be shifted out
// Correlates the input pins to the bits to be sent
bitWrite(bitsToSend, 0, digitalRead(inPin0));
bitWrite(bitsToSend, 1, digitalRead(inPin1));
bitWrite(bitsToSend, 2, digitalRead(inPin2));
bitWrite(bitsToSend, 3, digitalRead(inPin3));
bitWrite(bitsToSend, 4, digitalRead(inPin4));
bitWrite(bitsToSend, 5, digitalRead(inPin5));
bitWrite(bitsToSend, 6, digitalRead(inPin6));
bitWrite(bitsToSend, 7, digitalRead(inPin7));
bitWrite(bitsToSend, 8, digitalRead(inPin8));
bitWrite(bitsToSend, 9, digitalRead(inPin9));
bitWrite(bitsToSend, 10, digitalRead(inPin10));
bitWrite(bitsToSend, 11, digitalRead(inPin11));
bitWrite(bitsToSend, 12, digitalRead(inPin12));
bitWrite(bitsToSend, 13, digitalRead(inPin13));
bitWrite(bitsToSend, 14, digitalRead(inPin14));
//Shifting out the collected bit data to 74HC595
// Pull Latch Pin LOW before sending data
digitalWrite(latchPin, LOW);
// Shift the bits out:
shiftOut(dataPin, clockPin, LSBFIRST, bitsToSend);
// Turn on the Latch Pin so the LEDs can light up:
digitalWrite(latchPin, HIGH);
delay(200);
}