PIR sensor and gsm shield problem???

please check this code when i turn on gsm shield led also turn on and keep on and still PIR sensor not working :frowning:

//#include "SIM900.h"
#include <SoftwareSerial.h>
#include "sms.h"
#include "gsm.h"
//#include "string.h"

#define DEBUG_CODE_ON
#define DEBUG_ACTION_ON

SMSGSM sms;


boolean started=false;
boolean startSMS=false;
char smsbuffer[8];
char n_in[16];
char n_ref[12];
char  msg[1];
char pompe_on[] = "Pompeon";
char pompe_off[] = "Pompeoff";
int swtch=13;
int PIRSensor=2;
int incomingByte;
int val = 0;   


void setup() 
{
  
  // digit
  pinMode(swtch, OUTPUT);
 pinMode(PIRSensor, INPUT);

  //Serial connection.
  Serial.begin(9600);
  
  Serial.println("GSM Shield testing.");

  // GSM START
  if (gsm.begin(9600))
  {
    Serial.println("\nstatus=READY");
    started=true;  
  }
  else Serial.println("\nstatus=IDLE");
  
  if(started){
    #ifdef DEBUG_CODE_ON
    Serial.println("mise en ligne");
    #endif
    
    gsm.SimpleWriteln("AT+CMEE=2");
    delay(5000);
    #ifdef DEBUG_CODE_ON
    Serial.print("AT+CMEE=2");
    gsm.WhileSimpleRead();
    #endif
//
// PIN CODE
//
    #ifdef DEBUG_CODE_ON
    Serial.println("PIN CODE");
    #endif

 
//if (gsm.SendATCmdWaitResp("AT+CPIN ?", 1000, 100, "READY", 5) != 1 ) 
//      {
      gsm.SimpleWriteln("AT+CPIN=2343");
      delay(5000);
      #ifdef DEBUG_CODE_ON
      Serial.print("AT+CPIN=####");
      gsm.WhileSimpleRead();
      #endif
//      }

//
// INIT FOR SEND SMS
//
    gsm.SimpleWriteln("AT+CLIP=1");
    delay(500);
    #ifdef DEBUG_CODE_ON
    Serial.print("AT+CLIP=1");
    gsm.WhileSimpleRead();
    #endif

   
    gsm.SimpleWriteln("AT+CSCA ?");
    delay(5000);
    #ifdef DEBUG_CODE_ON
    Serial.print("AT+CSCA ?");
    gsm.WhileSimpleRead();
    #endif
       
    gsm.SimpleWriteln("AT+CMGF=1");
    delay(5000);
    #ifdef DEBUG_CODE_ON
    Serial.print("AT+CMGF=1");
    gsm.WhileSimpleRead();
    #endif

//
// CMD LOW
//
    #ifdef DEBUG_ACTION_ON
    Serial.println("INIT PUMP");
    #endif
    digitalWrite(swtch, LOW);
    
   

  }
  
  

};
void PIRsensor(){
    if(digitalRead(PIRSensor)==HIGH){   // read the input pin
  digitalWrite(swtch, HIGH);      // sets the LED to the button's value
  delay(1000);    
digitalWrite(swtch, LOW);   // delay in milisecond. 3000 = 3 second
  }


}
void loop() 
{ 
  if(started){
    if(digitalRead(PIRSensor)==HIGH){   // read the input pin
  digitalWrite(swtch, HIGH);      // sets the LED to the button's value
  delay(1000);    
digitalWrite(swtch, LOW);   // delay in milisecond. 3000 = 3 second
  }
 
  }
  /*
 
if(started)
    {
      
      
    
//    
// READ SMS
//
    #ifdef DEBUG_ACTION_ON
     Serial.println("Wait Read sms");
    #endif

    if(gsm.readSMS(smsbuffer, 16, n_in, 12))
    {
      #ifdef DEBUG_ACTION_ON
      Serial.println(n_in);
      Serial.println(smsbuffer);
      #endif
      startSMS=true;
      //
      // filter num gsm
      //
      /*
      if (memcmp(n_in,n_ref,11)==0)
      {
        #ifdef DEBUG_ACTION_ON
        Serial.println("Sender ok");
        #endif
        // ok
        startSMS=true;
      }
      */
      /*
    }
    
  
   //  
   // Action
   //
     if (startSMS){

  //
  // pump 
  //


    if (memcmp(smsbuffer,pompe_on,7)==0) 
    {
      digitalWrite(swtch, HIGH); 
      #ifdef DEBUG_ACTION_ON
      Serial.println("Pump On"); 
      #endif
    }
    
    if (memcmp(smsbuffer,pompe_off,7)==0) 
    {
      
       digitalWrite(swtch, LOW); 
       delay (100);
       PIRsensor();
     
      #ifdef DEBUG_ACTION_ON
      Serial.println("Pump Off");
      #endif
       
    }
 
  

//
// valve
//



    



     startSMS=false;
     // clear SMS
     gsm.SimpleWriteln("AT+CMGL=\"REC UNREAD\",0");

     }

      }
      delay(500);
 
*/
};