Does this make any sense to you?
const byte buttonPin = 2; // the number of the pushbutton pin
const byte ledPin = 13; // the number of the LED pin
boolean flag = true;
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup()
{
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
} //END of setup()
void loop()
{
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (flag == true && buttonState == HIGH)
{
delay(16);
// turn LED on:
digitalWrite(ledPin, LOW);
delay(16);
digitalWrite(ledPin, HIGH);
delay(16);
digitalWrite(ledPin, LOW);
flag = false;
}
if (flag == false && buttonState == LOW)
{
flag = true;
digitalWrite(ledPin, LOW);
}
} //END of loop()