 #define detectorPin 2
 #define resetPin 1
 
+unsigned long minPossibleLapTime = 40000;
 unsigned long baseLapTime = 86200;
+unsigned long defaultLapTime = 86200;
+
 unsigned long c1 = 30+250;
 unsigned long c2 = 5760+250;
 unsigned long c3 = 14120;
 unsigned long c4 = 32280;
 unsigned long c5 = 47440;
 unsigned long c6 = 59440;
-unsigned long c7 = 77200+1000;
-
-byte m1 = PWM_REV6;
-byte m2 = PWM_BRK;
-byte m3 = PWM_FWD6;
-byte m4 = PWM_REV6;
-byte m5 = PWM_BRK;
-byte m6 = PWM_FWD6;
-byte m7 = PWM_BRK;
-
+unsigned long c7 = 77200+2000;
 
 elapsedMillis timeElapsed; 
 unsigned long currentFrameTime;
 unsigned long lastLapTime;
 unsigned long lastFrameTime;
+
+float lapLapTimeRatio = 1.0;
 
 byte TURN = BLUE;
 


void setup(){
  pinMode(detectorPin, INPUT );
  lastLapTime = baseLapTime;
}

bool HasCrossedTime(unsigned long time){
  return ( lastFrameTime < time ) && ( time <= currentFrameTime );
}


}

void LapStarted(){
  if( startMode ){
    lastLapTime = defaultLapTime;
  }
  else{
    lastLapTime = currentFrameTime;
  }
  
  lapLapTimeRatio = 1.0f * lastLapTime / baseLapTime;
  
  startMode = false;
  currentFrameTime = lastFrameTime = timeElapsed = 0;
