help with visual countdown timer

i'm attempting to build a countdown timer consisting of 7 LEDs.

i haven't changed the delay times to 5 minutes yet but the idea is that each 5 minutes one LED turns off, then the final LED blinks for 5 minutes before the program ends.

my final LED blinks on and off twice then the program restarts - can anyone give me some suggestions to help me reach my goal (non-stop blinking of final LED for 5 minutes then the ending of the program)?

thanks in advance, code below

p.s. i'm very new so i'm kind of shooting in the dark in this code, all help appreciated
the 'repeatCounter' is my attempt to get the LED to keep blinking haha

void setup() {


  pinMode (2, OUTPUT); //begin
  pinMode (3, OUTPUT);
  pinMode (4, OUTPUT);
  pinMode (5, OUTPUT);
  pinMode (6, OUTPUT);
  pinMode (7, OUTPUT);
  pinMode (8, OUTPUT); //overtime

}

void loop() {

  int ledNumber = 2;
  digitalWrite (2, HIGH);
  digitalWrite (3, HIGH);
  digitalWrite (4, HIGH);
  digitalWrite (5, HIGH);
  digitalWrite (6, HIGH);
  digitalWrite (7, HIGH);
  delay (1000);

  digitalWrite (ledNumber, LOW);
  delay (1000);

  digitalWrite (ledNumber + 1, LOW);
  delay (1000);

  digitalWrite (ledNumber + 2, LOW);
  delay (1000);

  digitalWrite (ledNumber + 3, LOW);
  delay (1000);

  digitalWrite (ledNumber + 4, LOW);
  delay (1000);

  digitalWrite (ledNumber + 5, LOW);
  delay (1000);

  int (ledNumber = ledNumber + 6);
  int repeatCounter = 1;

  if (ledNumber > 7) digitalWrite (8, HIGH); ////blink red LED
  delay (150);
  digitalWrite (8, LOW);
  delay (150);
  repeatCounter + 1;

  if (repeatCounter < 300) digitalWrite (8, HIGH); ////blink red LED
  delay (150);
  digitalWrite (8, LOW);
  delay (150);
 


}

Fist, welcome!

Second, you naughty boy, you didn't read the "How to use the forum":wink: Please go back and edit your post and add code tags (</> in the menu) around the code.

The about the code.

Variable names for pins are usually easier to remember :wink:

Indent you code after each { to make it readable.

And of course it will only blink once. You're idea of counting the number of blinks is good, but then you have to loop over it :wink: Now the only loop is loop which is restarting the whole problem.

And if you really want to whole program to run just once, place everything inside setup.

This line does nothing:

repeatCounter+1;

What did you want it to do?

...and please lose the 'delay()' calls.

Set up a variable to keep track of the time, and make changes when that passes milestone times.

Using this method will allow you to check and perform other stuff like testing a button (e.g. to cancel the countdown) halfway through a 'delay' period.

int (ledNumber=ledNumber+6);

Why are there parentheses here? You are assigning a new value to an int, and then casting the resulting value to an int. That's pretty much useless, wouldn't you agree?

thanks for the constructive criticism guys, i'll do some more reading and get back

i'll also have a proper look at the posting rules (woops) - cheers for the warm welcome septillion