GSM Shield with Arduino M10

Hi Guys,

Anyone know how to send message to the user using this programming codes stated below?

I cannot seems to send any message to my phone but there is message display on my serial monitor.

Any helps will be greatly appreciated. Thank You.

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#include <SoftwareSerial.h>
#define PhoneNumber “+86XXXXXXX”
#define Message “Hello World!”

SoftwareSerial GSMSerial(10,11); //RX,TX
const int sentenceSize = 80;
int resetPIN = 12; //reset pin
int Button = 6; //button
int LED = 5; //LED

char sentence[sentenceSize];

void setup()
{
Serial.begin(9600); //baud rate at 9600
pinMode(resetPIN, OUTPUT); //reset pin to output
pinMode(Button, INPUT_PULLUP); //button pin to input
pinMode(LED, OUTPUT); //LED to output
digitalWrite(LED, LOW); //turn OFF initially

GSMSerial.begin(9600);

Serial.println(“System Startup - Ignition (Please Wait…)”);
digitalWrite(resetPIN, HIGH); // Turn ON the IGT
delay(200); // waits for 200ms
digitalWrite(resetPIN, LOW); // pulse it
delay(5000); // wait for few seconds for connection

Serial.println(“System Configuration and Reset”);
GSMSerial.println(“AT&F”); // Set all current parameters to manufacturer defaults
//GSMSerial.println(“Testing”);
ProcessGSM();

Serial.println(“Set to No Echo”);
GSMSerial.println(“ATE0”); // Set to no echo
ProcessGSM();

Serial.println(“Enable Notification when SMS Received”);
GSMSerial.println(“AT+CNMI=1,1”);
ProcessGSM();

Serial.println(“System Test”);
GSMSerial.println(“AT”); // Check if module is ok
ProcessGSM();

Serial.println(“SYNC pin enabled”);
GSMSerial.println(“AT^SSYNC=1”); // SSYNC=1, SYNC pin is uesd as STATUS LED
ProcessGSM();

Serial.println(“System Information”);
GSMSerial.println(“ATI”); // Display product identification information
ProcessGSM();

Serial.println(“System Network Quality”);
GSMSerial.println(“AT+CSQ”); // Network Signal quality
ProcessGSM();

Serial.println(“SIM Identification Number”);
GSMSerial.println(“AT^SCID”); // Display SIM card identification number
ProcessGSM();

}

void loop()
{
if(digitalRead(Button)== 1) //button pressed?
{
delay(10);
if(digitalRead(Button)== 1) //simple debounce
{
Serial.println(“Button Triggered”);
digitalWrite(LED, HIGH); //Light up - sending SMS
delay(5000);
SendSMS(); //send SMS
}
}
digitalWrite(LED, LOW);

}

void SendSMS()
{
//Transmit SMS
Serial.println(“Initialize before SMS”);
GSMSerial.println(“AT+CMGF=1”); // Set to Text mode
ProcessGSM();

Serial.print(“Set phone number:”);
Serial.println(PhoneNumber);
GSMSerial.print(“AT+CMGS= +86XXXXXXX”); // Set SMS number
GSMSerial.println(PhoneNumber); // Set SMS number
ProcessGSM();

Serial.print(“SMS message:”);
Serial.println(Message);
GSMSerial.print(Message “Hello”); // Send message
GSMSerial.write(0x1A); // Send
ProcessGSM();
digitalWrite(LED, HIGH); // Double confirm
}

void ProcessGSM()
{
int i,j,k;
char ch;
k = 0;
i = 0;
while(1){
delay(1);
if (GSMSerial.available()) //data available?
{
ch = GSMSerial.read();
Serial.print(ch);
if(ch == 79) //searching for O
{
i = 1;
}
else if(ch == 75 && i ==1) //searching for K
{
Serial.println();
break;
}
else if(ch == 62) //searching for >
{
Serial.println();
break;
}
}
if(k > 5000) //timeout
{
break;
}
k++;
}
}

void ClearArray(void)
{
for(char x=0; x < 30; x++)
sentence = ‘/0’;
}

Please use code tags when posting code, it makes it easier to read. Also you'll notice that the last part has been mangled.

SoftwareSerial GSMSerial(10,11); //RX,TX

The official shield uses D2 & D3.