 byte buff[BUFFER_MAX];
 unsigned char *intToStr;
 boolean motionDetected = false;
-int counter = 0;
+
 
 typedef struct myTimer{
   long time;

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


  */
  
  if(digitalRead(PIR)==HIGH){
    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!");
        motionDetected = true;
        resetTimer(&emailDelay);
      }
  
      String message = "Motion Detected ";
      message += (millis()-emailDelay.last)/1000;
      sendCommand(":Debug",message);
      resetTimer(&timer1);
    }
