unsigned long duration;
voide setup
{}
void loop()
{
receiveSMS();
duration=pulseIn(pin,HIGH);
wind=96000/duration+1;
}
}
void receiveSMS()
{
if(SIM900.available() >0)
{
inchar=SIM900.read();
if (inchar=='#')
{
delay(10);
inchar=SIM900.read();
if (inchar=='i')
{
delay(10);
inchar=SIM900.read();
if (inchar=='n')
{
delay(10);
inchar=SIM900.read();
if (inchar=='f')
{
delay(10);
inchar=SIM900.read();
if (inchar=='o')
delay(10);
}
Serial.println("receiveSMS has been read");
SIM900.println("AT+CMGD=1,4");
sendSMS();
}
}
}
}
}
void send sms();
{}
This is a part. I dont have problame to send SMS only to receive it
thank you for the help ! and sorry for my english! is BAD !