Noob question: How do I make a second loop?

I need to loop one set of code after another one is finished. I need this code to loop

digitalWrite (led5, HIGH); //starts beeping
delay(100);
digitalWrite (led5, LOW);
delay(100);

digitalWrite (led5, HIGH);
delay(100);
digitalWrite (led5, LOW);
delay(100);

digitalWrite (led5, HIGH);
delay(100);
digitalWrite (led5, LOW);
delay(100);
}

After a similar code ends.
Thanks a head of time guys!!!

Just put the new code after the first set of code.

Do you have other stuff going on too?

void loop(){
if (1stsequenceFlag == 1){
// perform 2nd sequence all the time after 1st sequence runs 1 time)
  }
if (1stsequenceFlag == 0){
// perform 1st sequence
1stsequenceFlag = 1;
  }
//do other loop stuff
} // end loop

could do similar with switch:case statements

void loopI){
switch (sequenceNumber){
case 0:
// do 1 time code
sequenceNumber = 1;
break;
case 1:
// do the repeating code
break;
}
// do other code in loop
}

Arrch:
Just put the new code after the first set of code.

I did that, but the timing gets all messed up. It works, just not the way I want it to. Besides, When I make the thing 20 led's are going to light up one after the other, and then a buzzer beeps.
Thanks for the input.

CrossRoads:
Do you have other stuff going on too?

void loop(){

if (1stsequenceFlag == 1){
// perform 2nd sequence all the time after 1st sequence runs 1 time)
 }
if (1stsequenceFlag == 0){
// perform 1st sequence
1stsequenceFlag = 1;
 }
//do other loop stuff
} // end loop




could do similar with switch:case statements


void loopI){
switch (sequenceNumber){
case 0:
// do 1 time code
sequenceNumber = 1;
break;
case 1:
// do the repeating code
break;
}
// do other code in loop
}

Thanks dude! I'll see how it works.

CrossRoads:
Do you have other stuff going on too?

void loop(){

if (1stsequenceFlag == 1){
// perform 2nd sequence all the time after 1st sequence runs 1 time)
 }
if (1stsequenceFlag == 0){
// perform 1st sequence
1stsequenceFlag = 1;
 }
//do other loop stuff
} // end loop




could do similar with switch:case statements


void loopI){
switch (sequenceNumber){
case 0:
// do 1 time code
sequenceNumber = 1;
break;
case 1:
// do the repeating code
break;
}
// do other code in loop
}

Ok. Now i'm going to bug you again, How would I implement that string of code? Sorry, i'm just learning c++ and this is all new too me.

Look up the Arduino reference (click!), and find out about the language and its commands.

Also search this forum for "blink without delay".

Arduino > Files > Examples > Digital > 1. Blink without Delay.