multiple leds...synchronized start with differing pulse widths

Hi there. Trying to figure out the correct code to blink multiple leds but with differing pulse widths. For instance, I would like send HIGH signal to led1 & led2 at the same time, but leave led1 on for 10ms and led2 on for 20ms. I don't have an oscilloscope otherwise I think I could probably figure this out. It seems the following will turn them on at the same time, but then how to I assign different delays to each?

digitalWrite (led1, HIGH); // turn on led1
digitalWrite (led2, HIGH); // turn on led 2

If I immediately follow this with

delay (10);

it will apply to both leds, correct?

Ultimately, I would like to, at time=0, turn on led1 & led2. At time = 10ms, turn led1 off (LOW). At time = 20ms, turn led2 off. And finally turn them on again at time = 30 ms.

Thanks for the help

Look at the blink without delay example built into the IDE.
You need what is known as a state machine, it is a style of coading.

seokeefe:
digitalWrite (led1, HIGH); // turn on led1
digitalWrite (led2, HIGH); // turn on led 2

If I immediately follow this with

delay (10);

it will apply to both leds, correct?

It doesn't "apply" to any LED, it just stops your program running for 10ms.

seokeefe:
Ultimately, I would like to, at time=0, turn on led1 & led2. At time = 10ms, turn led1 off (LOW). At time = 20ms, turn led2 off. And finally turn them on again at time = 30 ms.

If that's all you wanted to do you could do this:

digitalWrite (led1, HIGH); // turn on led1
digitalWrite (led2, HIGH); // turn on led 2

delay (10);
digitalWrite (led1, LOW);

delay (10);
digitalWrite (led12 LOW);

delay (10);
digitalWrite (led1, HIGH); // turn on led1
digitalWrite (led2, HIGH); // turn on led 2

But that style gets exponentially complicated as you try to add more LEDs and if the times need to vary then you'll be in big trouble.

For more LEDs you need to get rid of "delay()" and have the loop free-running with each LED looking at millis() and calculating whether it should be on or off.

eg.

void loop()
{
 // Chop time into 30ms intervals
  int t = millis()%30;
  digitalWrite (led1, t < 10);  // On for 10, off for 20
  digitalWrite (led2, t < 20);  // On for 20, off for 10
}

"delay()" is the devil's function, tempting young programmers in an trapping them. Avoid it if possible.