For my hardware, I need to check if the button was pressed, but I need to do things only once every half a second.
if (digitalRead(pin) == HIGH)
{
doStuff();
delay(500);
}
The above does not work, because I have to check other things in the main loop as well.