This is the code I use for receiving SMS and act accordingly , but when compiled I get an error saying "
sketch_apr20a.ino:1:23: error: SIMCOM900.h: No such file or directory
sketch_apr20a.ino:5:17: error: sms.h: No such file or directory
sketch_apr20a:7: error: 'SMSGSM' does not name a type
sketch_apr20a.ino: In function 'void setup()':
sketch_apr20a:23: error: 'gsm' was not declared in this scope
sketch_apr20a.ino: In function 'void loop()':
sketch_apr20a:35: error: 'sms' was not declared in this scope
sketch_apr20a:35: error: 'SMS_UNREAD' was not declared in this scope
"
Even if I add libraries I found over the internet , the same error occurs. Does anyone has links for sms.h and sim900.h ? or how do i rectify the errors?
#include "SIM900.h"
#include <SoftwareSerial.h>
#include "sms.h"
SMSGSM sms;
char number[]="97********";
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("NEW MESSAGE, 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);
};