SIM900 & Arduino

Hello, this is the first time I use the Arduino and GSM
I do not understand how the following code works ! please can help me and gives an example of using ??
#include "SIM900.h"

#include <SoftwareSerial.h>

#include "sms.h"

SMSGSM sms;

char number[]="3921234567";

char message[180];

char pos;

char *p;

void setup()

{

Serial.begin(9600);

if (gsm.begin(2400))

Serial.println("\nstatus=READY");

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

};

void loop()

{

pos=sms.IsSMSPresent(SMS_UNREAD);

Serial.println((int)pos);

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

Serial.print("NUOVO MESSAGGIO, POS=");

Serial.println((int)pos);

message[0]='\0';

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

p=strstr(message,"testpwd");

if(p){

Serial.println("PSWD OK");

p=strstr(message,"LEDON");

if(p){

Serial.println("LED ON");

digitalWrite(13,HIGH);

}

else{

p=strstr(message,"LEDOFF");

if(p){

Serial.println("LED OFF");

digitalWrite(13,LOW);

}

}

}

sms.DeleteSMS((int)pos);

}

delay(5000);

};

Is it working for SIM900??

because I also have a SIM900,and I command it with the AT command

yes it is working with sim900

Hi

I have a SIM900.

What are you looking to do exactly?

I do not understand how the following code works !

What part(s) don't you understand?

please can help me and gives an example of using ??

Question marks are used at the end of a sentence that asks a question. See the one above? There's another one.

I look for how I can test the code!

Why is pos defined as a char if you are going to cast it to an int everywhere?

I look for how I can test the code!

Send it two text messages - "testpwd" and "LEDON". The LED should turn on. Send it another text message - "LEDOFF". The LED should turn off.

If that doesn't work, Serial.print() to the rescue.

ok thx ! I will test now