hello friends
i am trying to read the sms using sim900 through arduino duemilanove(atmega 328)
so i am using GSM shield library and i found the following code
i am trying to read the sms but i am unable to do so
i tried to understand the code so i found that it is going into the loop but this code is unable to go in this function i think
if(gsm.readSMS(smsbuffer, 160, n, 20))
can anybody help me in this????
any help is eagrly appreciated
#include "SIM900.h"
#include <SoftwareSerial.h>
#include "sms.h"
SMSGSM sms;
//Simple sketch to send and receive SMS.
int numdata;
boolean started=false;
char smsbuffer[160];
char n[20];
void setup()
{
//Serial connection.
Serial.begin(9600);
Serial.println("GSM Shield testing.");
//Start configuration of shield with baudrate.
//For http uses is raccomanded to use 4800 or slower.
if (gsm.begin(2400)){
Serial.println("\nstatus=READY");
started=true;
}
else Serial.println("\nstatus=IDLE");
if(started){
}
};
void loop()
{
if(started){
//Read if there are messages on SIM card and print them.
if(gsm.readSMS(smsbuffer, 160, n, 20))
{
Serial.println(n);
Serial.println(smsbuffer);
}
delay(1000);
}
};