 }
 
 void extinguishFire(){
-  if (detectFire()) {
+  while (detectFire()) {
     if (frontUltrasonic.getDistance() > 3) {
       moveForward();
     } else {

  leftServo.attach(LEFT_SERVO_PIN);
  rightServo.attach(RIGHT_SERVO_PIN);
  extinguisher.attach(EXTINGUISHER_PIN);

  pinMode(IR_PIN, INPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  
//  if (frontUltrasonic.getDistance() > 3) {
//    moveForward();
//  } else {
//    moveBackward();
//  }
  
  extinguishFire();
  
