HII
This below code is used by me when i was working with Arduino and i was success at that time for SMS sending but this same approach is applied by me for Energia then i got error perhaps below code contains "#include <SoftwareSerial.h>" library to support serial communication. is Energia have such type of library to make serial communication simple and easy??? if yes then plz share it.
#include <SoftwareSerial.h>
#define rx 10
#define tx 11
SoftwareSerial gsm(rx, tx);
int a=0;
void setup()
{
Serial.begin(9600);
gsm.begin(9600);
}
void loop()
{
Serial.write("START");
gsm.print("AT+CMGF=1\r"); //Because we want to send the SMS in text mode
delay(1000);
ShowSerialData();
gsm.println("AT + CMGS = \"+919981359849\"");//send sms message, be careful need to add a country code before the cellphone number
delay(1000);
ShowSerialData();
S
gsm.println("A test message!:"+sensor1);//the content of the message
delay(1000);
ShowSerialData();
gsm.println((char)26);//the ASCII code of the ctrl+z is 26
delay(1000);
gsm.println();
}
void ShowSerialData()
{
while(gsm.available()!=0)
Serial.write(gsm.read());
}