Arduino target

Hello- is it possible to program the following sequence with an Arduino:

  1. button 1 pressed
  2. LED 1 lights
  3. button 2 pressed
    4.LED 2 lights and LED 1 stays on
  4. button 3 pressed
    6 LED 3 lights and LED 1 and 2 remain on

I have reviewed several things at one time (Demonstration code for several things at the same time - Project Guidance - Arduino Forum) but that does not seem to align with the goal for this program.

Currently, my sequence of if/else statements turns on LED1 and then turns it off before button two can be pressed.

Any advice is appreciated.

Thanks, RM

Hello- is it possible to program the following sequence with an Arduino:

Yes.

Does LED 1 have to be on before LED 2 can turn on? LED 2 before LED 3?

It's essentially a target game - hit all the targets and light all the LEDs within a specified time frame. So, the LEDs could be illuminated in any sequence. LED 2, LED1, LED3

Thanks.

if digitalRead(button1) digitalWrite(LED1, HIGH);
if digitalRead(button2) digitalWrite(LED2, HIGH);
if digitalRead(button2) digitalWrite(LED3, HIGH);

The LEDs will stay on until digitalWrite(LED1, LOW), for example.