DIY diver board -> Unexpected behaviour.

Hi,

I have used an Attiny85 and an SN74HC595N to make a driver board with some NPN 2222A transistors with 1kohm base resistors (so 5mA on the base…with hfe =100 about the 0.5A I want).

The circuit “seems” to work. I plug the LiPo in and they lights do some flashing…but not in an order I expect (looks random lights) and they suddenly stop in their last position after a few seconds.

I “assume” (which will probably make the ass out of me), that I have wired the chips up wrongly or I am doing some daft code issue.

Here is the schematic…

Full res: http://i.imgur.com/WroCm1C.jpg

And the code:

int latchPin = 1;    // Pin 12 on SN74HC595
int clockPin = 2;    // Pin 11 on SN74HC959
int dataPin = 0;    // Pin 14 on SN74HC595

byte leds = 0;

void setup()
{
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
}

void loop()
{


  for (byte i = 0; i < 255; i++) {
    
    updateShiftRegister(i);
    delay(500);
    
  }
}


void updateShiftRegister(byte leds)
{
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, MSBFIRST, leds);
  digitalWrite(latchPin, HIGH);
}

Any help would be greatly appreciated!