how to ignore a sensor being tripped the first time and start recording millis on the 2nd time it is tripped I am building a timing system that has a start, split and finish beams with this I am using a start gate that will drop when the race starts. when it drops it will trip the 1st sensor starting to count the millis which I am using to calculate the time. I am using IR sensors to that give me the 3 times based on the millis and then I do a calculation in excel that will give me the split and finish time.
Where I am running into issues is that after the person goes through the 3 timer sensors I have to close the start gate which trips the first sensor which messes up my times for the next person.
So I need to adjust my sketch so it takes this into consideration when it starts counting the millis. Basically I am thinking it needs a line of code to have the 1st sensor == LOW once and do nothing and then on the 2nd time that same sensor is == LOW it records the millis from that point.
Below is the sketch I am working on.
//timer
unsigned long start, reaction, push, elapsed; 


void setup()
{
  Serial.begin(115200);
  pinMode(2, INPUT); // start switch
  pinMode(3, INPUT); // split sensor
  pinMode(4, INPUT); // finish sensor
}


void loop(){
   
if (digitalRead(2) == LOW)
  {

    start = millis();
    
  }



  if (digitalRead(3) == HIGH)
  {

    reaction = millis();
 //   delay(200); // for debounce   
    
    
  }

     if (digitalRead(4)==HIGH)
      {

       push=millis();
       delay(500); // for debounce

    Serial.print(start);
    Serial.print(&quot;,&quot;);
    Serial.print(reaction);
    Serial.print(&quot;,&quot;);
    Serial.print(push);
    Serial.println();

  }

}
The start time will default to zero, so you could change it to:
if (digitalRead(2) == LOW &amp;&amp; start == 0)
  {

    start = millis();
    
  }