i m using gsm sim900 with arduino uno to receive sms. based on sms i need to on and off the led.
i am able to receive the sms with long description. like (+CMT: "+919738978924","","15/03/09,17:04:15+22" Hello how are u?).
i want to store "hello how are u ?" in some variable . can you please help me in doing this.
here is my executable code :
void setup ()
{
Serial.begin(9600);
Serial.write("AT+CMGF=1\r"); //set GSM to text mode
delay(1500);
Serial.write("AT+CPMS=\"SM\"\r"); //Preferred SMS Message Storage
delay(1000);
Serial.write("AT+CMGR=1\r");
Serial.write("AT+CNMI=2,2,0,0,0\r");
delay(1000); //list the first message from SIM //Memory
while(1)
{
if(Serial.available())
{
Serial.write(Serial.read());
}
}
}
void loop()
{
}