i have read incoming message of module , store in char variable.
how can parse , keep sender in value , sms message another. code is
how can parse , keep sender in value , sms message another. code is
code: [select]
#include <softwareserial.h>
softwareserial sim900(7, 8);
char incoming_char=0;
void setup()
{
serial.begin(19200); // serial monitor
sim900.begin(19200); // gsm shield
sim900power(); // turn on shield
delay(20000); // give time log on network.
sim900.print("at+cmgf=1\r"); // set sms mode text
delay(100);
sim900.print("at+cnmi=2,2,0,0,0\r");
// blurt out contents of new sms upon receipt gsm shield's serial out
delay(100);
}
void sim900power()
// software equivalent of pressing gsm shield "power" button
{
digitalwrite(9, high);
delay(1000);
digitalwrite(9, low);
delay(7000);
}
void loop()
{
// display text gsm shield sends out on serial monitor
if(sim900.available() >0)
{
incoming_char=sim900.read(); //get character cellular serial port.
serial.print(incoming_char); //print incoming character terminal.
}
}
quote
how can parse ithow can parse data haven't stored? answer can't. first step store data.
once have stored data, how have stored defines techniques can used parse data.
Arduino Forum > Using Arduino > Programming Questions > Receive sms gsm module sim900 and parse it
arduino
Comments
Post a Comment