control multiple led using ldr and gsm

hi all,

i have a sketch which multiple led is being control on/off by using ldr. They also can be turn on/off automatically by sms.

the code can compile. I got sms after initialization setting " the system is ready" but the led is not working. i hope somebody could give me some pointer?

thanks.

#include "SIM900.h"
#include <SoftwareSerial.h>
#include "sms.h"

SMSGSM sms;
int a = 8 ;
boolean started=false;
char pos;
char message[180];
char number[13];
char *LedOn;
char *LedOff;

int LDR = 0;     //analog pin to which LDR is connected, here we set it to 0 so it means A0

int LDRValue = 0;      //that’s a variable to store LDR values

int light_sensitivity = 500;    //This is the approx value of light surrounding your LDR (on observation:700 on afternoon, 500 on morning

void setup()

{

  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(12, OUTPUT);
  digitalWrite(8, LOW);
  digitalWrite(9, LOW);
  digitalWrite(10, LOW);
  digitalWrite(11, LOW);
  digitalWrite(12, LOW);

  number[12]='\0';

  Serial.begin(9600);

  if (gsm.begin(9600)) 

  {
    Serial.println("\nstatus=READY");
    started=true;

    }
   else 
        Serial.println("\nstatus=IDLE");

    if(started) 
    {
        if (sms.SendSMS("+00000000000", "The system is ready"))
        {
          Serial.println("\nSMS sent OK.");
        }
        else
        {
          Serial.println("\nError sending SMS.");
        }      
    }
}


void loop()

{
    LDRValue = analogRead(LDR);      //reads the ldr’s value through LDR 
   
    Serial.println(LDRValue);       //prints the LDR values to serial monitor
   
    delay(100);        //This is the speed by which LDR sends value to arduino
    
 for (int a=8; a < 13; a++)
 {
    if (LDRValue < light_sensitivity) 
      {
        
        digitalWrite(a, HIGH);
      }
    else
      {
        digitalWrite(a, LOW);
      }
  if(started)

  {

    pos=sms.IsSMSPresent(SMS_UNREAD);

    if((int)pos>0 && (int)pos<=20)

    {

      message[0]='\0';

      sms.GetSMS((int)pos,number,message,180);

      LedOn = strstr(message,"Led on");

      LedOff = strstr(message,"Led off");

     
      if(LedOn)  digitalWrite(a, HIGH);
      if(LedOff)  digitalWrite(a, LOW);
      
      

     
      sms.DeleteSMS((int)pos);

    }

    delay(5000);

  }
 }
 }
    delay(100);        //This is the speed by which LDR sends value to arduino

That comment is nonsense.

What does sending "Led on" mean? You are checking for an SMS when a is 8. If there is one, you check the contents and turn pin 8 on or off and delete the message. Then, a is incremented to 9, and you check for an SMS. If there is one, you check the contents and turn pin 9 on or off and delete the message. You repeat that for pins 10, 11, and 12.

That just seems bizarre.