Absolute newbie, button detect

Hi
Im totally new to Arduino, and at my age (42) its hard to learn new tricks :slight_smile:

To descibe my goal:
2 presses on a button (each min 2 sec.) within 15sec, will trigger an output for 5 min.
When activated, 2 presses (each min. 2 sec) will deactivate the output.

Sounds simple, but i`ve tried several aproaches without luck :frowning:
Triggering the output for 5mins by pressing at button is no problem, but how on earth can i get Arduino to "count" 2 presses within 15sec ?
The reason for long (2sec) presses, is to eliminate "false" presses, and the reason for 2 presses is that the remotecontrol that will "press" sends 2 identical outputs each time i activate it.

Can/will anyone guide me in the right direction please :slight_smile:

, but how on earth can i get Arduino to "count" 2 presses within 15sec ?

Note the time (use millis()) that you detect the first press, then note the time you detect the second.
Subtract the first from the second to give the gap in milliseconds.

Maybe i did not explain my self correct..
The task is to detect 2 presses of 2 secs duration each, both within 15sec
I should have asked how to detect a press of min. 2 sec, AND how to detect 2 of these within 15 sec

Yup, pretty much the same solution.