   */
   
   if(digitalRead(PIR)==HIGH){
-<<<<<<< HEAD
     digitalWrite(LED1,HIGH);    
     
     if(timerDone(&timer1)){ 
+      
       if(!motionDetected){         // One Shot
+        sendCommand(":Debug","Taking photo");
+        sendCommand(":Webcam","capture00.jpeg");
         //sendCommand(":EmailPhoto","jerullan@yahoo.com,Security Alert,Motion triggered alarm!");
-        sendCommand(":Debug","Taking photo");
         motionDetected = true;
         resetTimer(&emailDelay);
       }
   
-=======
-    
-    if(timerDone(&timer1)){ 
-      if(!motionDetected){         // One Shot
-        sendCommand(":EmailPhoto","jerullan@yahoo.com,Security Alert,Motion triggered alarm!");
-        digitalWrite(LED1,HIGH);
-        motionDetected = true;
-        resetTimer(&emailDelay);
-      }
-      
->>>>>>> e2b6f4e6d6a17e06fd105c27e6263f6fb8372219
-      counter++;
       String message = "Motion Detected ";
-      message += (millis()-emailDelay.last);
+      message += (millis()-emailDelay.last)/1000;
       sendCommand(":Debug",message);
       resetTimer(&timer1);
     }

// Timer utilities functions

boolean timerDone(struct myTimer* timer){
  if( (millis()-timer->last) > timer->time){
    timer->done = true;
    return true;
  }

    if(timerDone(&emailDelay)){
      motionDetected = false;
    }
    resetTimer(&timer1);
  }

