Button that gives an Input, Has a small delay --- then gives another I'm pretty new to the Arduino scene, and my question will likely be solved simply by some more experienced fellows. I'm trying to create a code for a switch/ button that when you press it, it generates an output--- then waits (delays?) and produces another (after that set amount of time) before ending that transfer of information.  Can any insight be shed on this? What would that look like? For example, the code that I am imagining is something like this : 

if(buttonisPressed){

  Function1 = 1;   // Original output is issued

  delay(1000);  // Set time delay for the next output 

  Function2 = 1; // The second output follows suit after the set amount of delay time (only after one press, without a secondary)

}


This is a snippet of the code I am using, but I haven't been able to get it to work. 

Thanks so much for your help! Any advice at all would be greatly appreciated.
A standard way to do this is to connect a digital i/o pin via a (normally open) push button to ground. Internally in the Arduino a pullup resistor can be activated to keep the pin on a high level when de button is open. For example when pin #8 is used: pinMode(8, INPUT_PULLUP). The program watches the state of the pin to detect whether the button has been pushed. An extensive tutorial about using switches for input to microcomputers you can find here: http://www.gammon.com.au/forum/?id=11955

Be sure to familiarize yourself with a phenomenon called "contact bouncing": when the button is pressed or released the contacts don't open or close immediately but go through a series of rapid open/close/open/etc. states. The best information I know about how to handle this you can find here: http://www.ganssle.com/debouncing.htm