title: Arduino sending sms in GSM sim900 error
body: <p>I have an Arduino Mega 2560 and a sim900 gsm module.
  I interfaced them successfully and written the code. Its working, but I can only send 1 sms at a time in the while loop. That means when I write a while loop to execute the sendsms() 5 times by using a while loop. Only one sms is sent.. and it stops...</p>
  
  <p>The code is below:</p>
  
  <pre><code>#include &lt;SoftwareSerial.h&gt;
  #include &lt;String.h&gt;
  SoftwareSerial mySerial(52, 53);
  
  void setup()
  {
       mySerial.begin(19200);      // the GPRS baud rate   
       Serial.begin(19200);    // the GPRS baud rate 
       delay(500);
  
  }
  
  int x = 0;
  
  loop()
  {
  
      while (x&lt;5)
      {
       SendTextMessage();  
       x++;
       }  
  
   }
  
  
  void SendTextMessage()
  {
   mySerial.print("AT+CMGF=1\r");
   delay(100);
   mySerial.println("AT + CMGS = \"+94776511996\"");
   delay(100);
   mySerial.println("hey wow");
   delay(100);
   mySerial.println((char)26);
   delay(100);
   mySerial.println();
  }
  </code></pre>