const int LEDpin = 12;
const long onDuration = 400;// OFF time for LED
const long offDuration = 800;// ON time for LED
int button_in = 13;
int button_state = LOW;
int LEDState =LOW;// initial state of LED
long rememberTime=0;// this is used by the code
bool    fHasLooped  = false;

void setup() {
  pinMode(LEDpin,OUTPUT);// define LEDpin as output]
  Serial.begin(9600);
  digitalWrite(LEDpin,LEDState);// set initial state
  pinMode(button_in, INPUT);
  
}
void loop() {
Serial.print("flag status :");Serial.println(fHasLooped);
button_state = digitalRead(button_in);
if (button_state == HIGH) {
  fHasLooped = false;
}
if ( fHasLooped == false ) 
  {
  for ( int x = 0; x < 30; x++ )
    {
       LEDState = !LEDState; 
       digitalWrite(LEDpin,LEDState);// turn the LED ON or OFF
       delay (300);
    }
fHasLooped = true;
  } 
}