I suggest you go to the "Learning" section of the website and look at the button state change example among others, this might be the kind of thing you are after.
Yeah, I know the button state change detection. I just need to count the number of presses within 1000ms. I don't know how to implement the timer (using the arduino clockcycles, pref.) together with the counter...
I receive 1 HIGH input. That should start a timer function that runs for 1000ms. Together with the timer, the counter should start which records how many presses are received. The counter should store that amount of presses.
When the timer reaches 1000ms, both the timer and the counter stop.
Then, the code checks how many presses were registered and starts a function (like put led1 on) that comes with that specific number of presses (so: If 2 presses: function2, If 3 presses: function3 etc etc)
while (button == LOW) {}; // wait for the pin to go HIGH
timeNow = millis ();
while (timeNow + 1000 > millis ()) {
count_button_presses ();
}
switch (the_number_of_presses) {
case 0: // do something
break;