To launch 2 LED same time with different intervals and with no. of repeat

hi, i have code as below:
the code flow is like i press a button, LED1 will on for delay(timingLED1a) then off for delay(timingLED1b), then repeat follow by the No.Repeat been set. But my code cant make the LED2 to turn on same time together with LED1. Can someone help me on this?

void FireLED1()
{
  for(int i=0; i < No.Repeat; i++)
  {
    digitalWrite(LED1, HIGH);
    delay(timingLED1a);
    digitalWrite(LED1, LOW);
    if(i < (No.Repeat - 1))
    {
      delay(timingLED1b);
    }
  }
}

void LED2()
{
  for(int i=0; i < No.Repeat2; i++)
  {
    digitalWrite(LED2, HIGH);
    delay(timingLED2a);
    digitalWrite(LED2, LOW);
    if(i < (No.Repeat2 - 1))
    {
      delay(timingLED2b);
    }
  }
}

Get rid of calls to "delay". Have a look at the blink without delay example for clues on how to do this.

Hi AWOL, I have look into that sample code blink without delay but i still dont get how should i modify my code into it. can u help to explain a little bit more on it?

AWOL: Get rid of calls to "delay". Have a look at the blink without delay example for clues on how to do this.

It might help if you post your code.

the code is from below: http://www.mrossphoto.com/PHSPT/Precision_High_Speed_Photography_Trigger_v2_3.pde

i wanted to modify the part for valveA, ValveB, ValveC, ValveD. i wan the valve can be turn on same time when launch.

example: valveA launch same time with valveB but valveA open longer than valveB and valveA repeat for 3 times and valveB repeat for 2 times. and i might want to add in some timer for valveB for it to open a bit later after valveA open.

hope u get what i mean. sorry for my poor description..

AWOL: It might help if you post your code.

blank without delay is what you want as suggested..

the approach is more or less a 'timer' based approach..

YOU DO NOT USE DELAYS..

but instead, have variables defined for a length/period of time, that is checked on each loop...

when that 'time limit' has been reached it will trigger the action you want (ie: turn on or off led 1.. or turn on off led 2)

foosi: Hi AWOL, I have look into that sample code blink without delay but i still dont get how should i modify my code into it. can u help to explain a little bit more on it?

Imagine that you're making a boiled egg, a slice of buttered toast and a cup of tea. What your current code does is to put the egg on and wait for 3 minutes, then put the toast on and wait till it's done, butter it and, finally, boil the kettle to make the tea. I'm sure that's not how you'd do it.

You'd put the egg, toast and kettle on together and keep checking the elapsed time to see if the egg is done, the toast is done and the kettle has boiled. That's how you need to arrange your sketch.