Microcontroller › Arduino › how to interface gsm module sim900a to arduino › here is the code
January 26, 2016 at 1:21 pm
#13660
rupa
Participant
but u dont find anything going on serial monitor but u will get sms to ru phone
#include <SoftwareSerial.h>
SoftwareSerial mySerial(9, 10);
void setup()
{
mySerial.begin(9600);
Serial.begin(9600);
delay(2000);
//set GSm to test mode
}
void loop()
{
if (Serial.available()>0)
switch(Serial.read())
mySerial.println("AT+CMGF=1");
delay(1000);
mySerial.println("AT+CMGS="+918885751592"r");
delay(1000);
mySerial.print("test messsage from arduino ….hello…how r u");
delay(1000);
mySerial.println((char)26);//sends ctrl+z end of message
delay(1000);
}