You are on page 1of 1

#include <SoftwareSerial.

h> SoftwareSerial cell(0,1); // We need to create a serial port on D2/D3 to talk t o the GSM module char mobilenumber[] = "+919840138220"; // Replace xxxxxxxx with the recipient's mobile number void setup() { //Initialize serial ports for communication. cell.begin(9600); delay(3000); // give the GSM module time to initialise, locate network etc. // this delay time varies. Use example 26.1 sketch to measure the amount // of time from board reset to SIND: 4, then add five seconds just in case } void loop() { cell.println("AT+CMGF=1\r\n"); // set SMS mode to text delay(2000); cell.write("\"AT+CMGS=\"+919629594907\"\r\n\""); // now send message... delay(2000); // give the module some thinking time cell.print(" we got o/p.... msg 4m gsm module "); cell.write(26); // ASCII equivalent of Ctrl-Z cell.write("\r\n"); delay(3000); // the SMS module needs time to return to OK status do // You don't want to send out multiple SMSs.... or do you? { delay(1000); } while (1>0); } // our message to send

You might also like