GSM Shield .. problem in my code .. LED ON /OFF

Hi,

#include "SIM900.h"
#include <SoftwareSerial.h>
#include "sms.h"
SMSGSM sms;
int  numdata;
boolean started=false;
char smsbuffer[160];
String msg=String("");
int  led_a=13;
char n[20];


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

  if (gsm.begin(2400)){
    Serial.println("\nstatus=READY");
    started=true;  
  }
  else Serial.println("\nstatus=IDLE");
  
  if(started){
    if (sms.SendSMS("+60102333893", "The iron has been switched off."))
      Serial.println("\nSMS sent OK");
  }
 
}



void setup()
{
Serial.begin(9600);
Serial.println("GSM shield testing.")
if(gsm.begin(9600))
{
Serial.println("\nstatus=READY");
Started=true;
}
else Sarial.println("\nstatus=IDLE");
pinMode( 13, OUTPUT );
Digitalwrite(13, HIGH);
}

void loop()
{
  processSms();
}

void processSms()
{
if(gsm.readSMS(smsbuffer,160,n,20))
{
Serial.println(n);
Serial.println(smsbuffer);
}
delay(1000);
msg=String(smsbuffer),
if (n=="+60102333893"){
if( msg.indexof("ona")>=0)
{
digitalwrite( led_a,  low);
if (sms.SendSMS("+60102333893", "a is on"))
Serial.println("\nSMS sent ok");
msg=String("")
}
if( msg.indexof("offa")>=0)

{
digitalwrite( led_a,  HIGH);
if (sms.SendSMS("+60102333893", "a is off"))
Serial.println("\nSMS sent ok");
msg=String("")
}}}

problem :

sketch_feb18b.ino: In function ‘void setup()’:
sketch_feb18b:38: error: expected ;' before 'if' sketch_feb18b:43: error: 'else' without a previous 'if' sketch_feb18b:43: error: 'Sarial' was not declared in this scope sketch_feb18b:45: error: 'Digitalwrite' was not declared in this scope sketch_feb18b.ino: In function 'void processSms()': sketch_feb18b:62: error: expected primary-expression before 'if' sketch_feb18b:62: error: expected ;’ before ‘if’
sketch_feb18b:77: error: expected `}’ at end of input

plz help me .

You have several semicolons missing. Every statement should end with one.

And...

While it it won't cause any errors with the compilation or execution of your sketch, you need to be consistent with the open brace '{'. Either on the same line as the condition / function name, etc, or on a line of its own. Not a mixture. Personally I would suggest on a line of its own but that's up to you.

Once you have done that then the structure of your sketch will become clearer, assisting in locating any logic errors.

Thank you dannable

CODE which he concluded assembly planned I want to do.

What I want from this code is run and extinguish the LED across Shield GSM SIM900 used across Arduino Uno .

In the operation of Pin 13

Is it possible to help me to modify the code mistakes?

Your first error message is

sketch_feb18b:38: error: expected `;' before 'if'

Look at line 38. There is a semi colon missing on the line before it.

Repeat the process.

How have you got the jumpers (left hand side of photo nearest camera) set up?

#include "SIM900.h"
#include <SoftwareSerial.h>
#include "sms.h"
SMSGSM sms;
int  numdata;
boolean started=false;
char smsbuffer[160];
String msg=String("");
int  led_a=13;
char n[20];


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

  if (gsm.begin(9600)){
    Serial.println("\nstatus=READY");
    started=true;  
  }
  else Serial.println("\nstatus=IDLE");
  
  if(started){
    if (sms.SendSMS("+60102333893", "The iron has been switched off."))
      Serial.println("\nSMS sent OK");
  }
 
}



void setup()
{
Serial.begin(9600);
Serial.println("GSM shield testing.");
if(gsm.begin(9600))
{
Serial.println("\nstatus=READY");
started=true;
}
else Serial.println("\nstatus=IDLE");
pinMode( 13, OUTPUT );
digitalWrite(13, HIGH);
}

void loop()
{
  processSms();
}

void processSms()
{
if(gsm.readSMS(smsbuffer,160,n,20))
{
Serial.println(n);
Serial.println(smsbuffer);
}
delay(1000);
msg=String(smsbuffer);
if (n=="+60102333893"){
if(msg.indexOf("ona")>=0)
{
digitalWrite( led_a, LOW);
if (sms.SendSMS("+60102333893", "a is on"))
Serial.println("\nSMS sent ok");
msg=String("");
}
if( msg.indexOf("offa")>=0)

{
digitalWrite( led_a, HIGH);
if (sms.SendSMS("+60102333893", "a is off"))
Serial.println("\nSMS sent ok");
msg=String("");
}}}

This code after edited …

How have you got the jumpers (left hand side of photo nearest camera) set up?

I’ve put jumpers by explaining one of the sites .

Is there a certain position of Jumpers in their use of the messages SMS ?

Well the jumpers need to be in the correct place for the software you are using, and I assume that you have followed the instructions in whichever article you are following?

Does the program work as expected now?