ATmega8L power issue
I tested your sketch after adding pinMode(13, OUTPUT) in the setup, and it works as you intended.

But, as you don't post your schematic, I was only able to chech on-board LED blinking.

void setup()
{
  pinMode(13, OUTPUT);

  for (int i=0; i &lt; 3; i++) {
      digitalWrite(13, HIGH);
      delay(100);
      digitalWrite(13, LOW);
      delay(100);
  }

    // put your setup code here, to run once:
    for(i=startDigitalPin; i&lt;=maxDigitalPin; i++) {
        pinMode(i, OUTPUT);
       digitalWrite(i, LOW);
    }
}


I also reduce your code using a for loop.