help me

hello
I ask if you like me a aidee
I made SEVERAL attempts but not result
To turn the LED L1 must successively:

  • Press P1
  • Release P1
  • Press again P1
  • Press P2 (without releasing P1)
  • Release P2
  • Release P1. It was then that L1 should illuminate for three seconds.

The execution speed of the sequence is not important. Any other manipulation is considered false. It must be followed:

  • Waiting until no further key is pressed
  • Waiting for an additional second.
    Then the program should resume its detection.

Okay. You can do that. But don't use delay() because during delay() no button activity can be detected.

Learn Blink Without Delay so that you can watch the button and timer at the same time.
Also learn about button debounce.
Search for these and read just to be able to ask better questions, save typing and time.

I suggest using the approach demonstrated in the state change example to detect button presses and releases, and using a finite state machine to record where you are in the expected sequence of button presses and releases etc. Robin2 posted an example sketch recently which demonstrated a good way to combine these two approaches.

I also suggest changing your subject line to something that indicates what sort of help you're asking for. Many people only bother reading threads if the subject line looks interesting and relevant to them, so a meaningless subject line like the current one may reduce the number of people helping you.