Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIM900, erro ao salvar manipular SMS(mensagem) #106

Open
GoogleCodeExporter opened this issue Mar 20, 2015 · 0 comments
Open

SIM900, erro ao salvar manipular SMS(mensagem) #106

GoogleCodeExporter opened this issue Mar 20, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

SIM900, error handling when saving SMS (message)
  I'm trying to manipulate an SMS, there is an error that I can not fix.
I'm using an arduino uno, a shield SIM900 (IComSat v1.1)
My goal is to save a mesagem text, select it and starting characters of SMS and 
save in a variable.
types of variables that intend to use:
int
char

I'm trying velop a code for that, I'm not getting bad.
can anyone help me please
am new in this area

<pre>
<code>
///////////////////////////////////////////////////////////////////
#include <SoftwareSerial.h>
char inchar; 
SoftwareSerial SIM900(2, 3);
int led4 = 13;
int a0;
int a1;
char a2;
void setup()
{
  SIM900.println("AT+CMGD=1,4");
  Serial.begin(19200);
  pinMode(led4, OUTPUT);
  digitalWrite(led4, HIGH);
  SIM900.begin(19200);
  SIM900.print("AT+CMGF=1\r");  
  delay(100);
  SIM900.print("AT+CNMI=3,3,0,0,0\r");
  delay(100);
  Serial.println("Iniciando...");
}


void loop()
 {
  if(SIM900.available() >0)
    {
    Serial.println("new sms");
    inchar=SIM900.read();
    if (inchar[0]=='1') //character position 1
     {
     inchar[0]==a0;
     Serial.println("first variable saved");
     if (inchar[1]=='2') //character position 2
     {
      inchar[0]==a1; 

     if (inchar[2]=='e') //character position 3
      {
      inchar[0]==a2; 
     Serial.println(a1,a2,a3);
     digitalWrite(led4, LOW);
      }

      }


      }
       SIM900.println("AT+CMGD=1,4");
     }
}
///////////////////////////////////////////////////////////
<\code>

Original issue reported on code.google.com by [email protected] on 23 Aug 2014 at 12:13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant