Transmitting SMS from a GSM modem


Ive got an project going on bout trying to send an text-message from my arduino to my mobile-phone using an GSM. The program im now using is this:

#include <SoftwareSerial.h>

SoftwareSerial cell(2, 3); // RX, TX
char mobilenumber[]="99497322";  // Replace xxxxxxxx with the recipient's mobile number
char textmessage[160]; // used to hold contents of message to send
int b=0;
void setup()
{  //Initialize serial ports for communication.
delay(35000); // 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
pinMode(13, OUTPUT); // use the LED for status
void startSMS()
// function to send a text message
digitalWrite(13, HIGH);
cell.println("AT+CMGF=1"); // set SMS mode to text
cell.write((byte)34); // ASCII equivalent of "
cell.write((byte)34);  // ASCII equivalent of " HOME MADE. 
delay(500); // give the module some thinking time
void endSMS()
cell.write((byte)26);  // ASCII equivalent of Ctrl-Z
delay(15000); // the SMS module needs time to return to OK status
digitalWrite(13, LOW);
void loop()
b=random(0, 99);
for (int a=0; a<100; a++)
if (a==b)
cell.print("The random number is: ");
} while (1>0);

And I got som problem with getting it working, hope that someone maybe would be able to help me :wink:

Moderator edit: CODE TAGS

And I got som problem


does the mobile number need to have 9+ 949-7322, or does it need area code 9+(XXX) 949-7322 ? your original number: 99497322

What problems are you getting?