   attachInterrupt(4, countPulseLeft, CHANGE);
   
   // Sound Sensor
-  pinMode(ledPin, OUTPUT);
   pinMode(sensorPin, INPUT);
+
+  // Extinguisher
+  pinMode(flame_sensor, INPUT);
+
+  extingusher_servo.attach(servo_pin);
+  extingusher_servo.write(0);
 }
 
 void loop() {
   // put your main code here, to run repeatedly:
   if (soundStart() || digitalRead(13)) {
+    digitalWrite(SOUND_LED, HIGH);
     robotOn = !robotOn;
   }
+
+  delay(300);
 
   if(robotOn){
 //    Serial.println(pulseRight);
 //    definedStartSearch();
-     digitalWrite(SOUND_LED, HIGH);
-	  digitalWrite(FLAME_LED, HIGH);
-	  delay(1000);
-	 digitalWrite(SOUND_LED, LOW);
-	  digitalWrite(FLAME_LED, LOW);
-	  delay(1000);
+//	  digitalWrite(FLAME_LED, HIGH);
+//	  delay(1000);
+//	  
+//	  digitalWrite(FLAME_LED, LOW);
+//	  delay(1000);
+    extinguish();
   }
   else{
     hDrive(0.0, 0.0, 0.0);

#define SOUND_LED 52

#define WALL_DISTANCE 7

Motor leftMotor1(3, 4);
Motor leftMotor2(5, 6);

double getAngle();

// Sound Sensor
int sensorPin = A0;   
int sensorValue = 0;
bool robotOn = false;
bool soundStart();

// Extinguisher
void extinguish();

void setup() {
  Serial.begin(9600);
