Kill Switch

For our robot we would like to use a button that when pressed, will stop the robot and then when we press it again, it will start the robot up again.. Any suggestions on how to code this?

The most naive implementation:

while(digitalRead(killSwitchPin) == killSwitchPressedState) {}

This assumes a maintained, rather than momentary button is used but momentary buttons are more common. This is blocking code so the robot will not be able to do anything else(such as monitoring other inputs) while the "kill switch" is activated. To make it non-blocking or use a momentary button you will need to set a flag variable used to disable any code that moves the robot when the button is pressed and then clear the flag when the button is released or pressed again(maintained vs momentary). You will also want to learn about debouncing(see File > Examples > 02.Digital > Debounce and http://www.arduino.cc/en/Tutorial/Debounce). You may also want to look at other examples and tutorials from File > Examples > 02.Digital such as Button and InputPullup.