This uses the internal pull up resistor. Just connect the button to ground and the other side to digital pin 12. You don't NEED an led for this, because the board has one built on to it, but you can use one if you want to. It would go on digital pin 13.
This code SHOULD work. I tested it a long time ago, and I can't remember if I modified it or not...
int ledPin = 13;
int buttonPin = 12;
int currentState;
int previousState;
int counter;
void setup(){
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT);
digitalWrite(buttonPin, HIGH);
}
void loop(){
currentState = digitalRead(buttonPin);
if(currentState == LOW && previousState == HIGH){
counter ++;
digitalWrite(ledPin, HIGH);
}
else if(currentState == HIGH){
digitalWrite(ledPin, LOW);
}
if(counter >= 2){
counter = 0;
}
}