Arduino Nano, ICSP header and 595 Shift register
It is extremely confusing to have a variable val and then use _val in your function but then:

  shiftOut(dataPin,clockPin,LSBFIRST,val);


As James pointed out, you are not sending the value passed to the function, to the shift register.

Also this is just going to give you a boolean:

 updateRegister(!i);


Why take "not i" there?



I suggest you use SPI and not muck around with shiftOut. I have a page about the 595 chip including example code. eg.

#include &lt;SPI.h&gt;

const byte LATCH = 10;

void setup ()
{
  SPI.begin ();
}  // end of setup

byte c;
void loop ()
{
  c++;
  digitalWrite (LATCH, LOW);
  SPI.transfer (c);
  digitalWrite (LATCH, HIGH);
  delay (20);
}  // end of loop