/*
PLEASE READ FIRST

 

First you have to send the phone number and then the text, which you want to send to this number,
 but in between you must make a break of at least one second, until you are sending something new.

When you have send a number and a text, it starts all over again, and you can send a new number and a new text.

Download the code on your Arduino and start the Serial Monitor, then start the Arduino SMS App and connect your phone with your Bluetooth module.

HAVE FUN
*/


#include <SoftwareSerial.h>
//                      Rx  Tx
SoftwareSerial mySerial(10, 8); //take your Rx and Tx pin of your Bluetooth Module
char numberortext=0;
char enable=0;

void setup()
{
    Serial.begin(9600);         //take your Baud rate
    mySerial.begin(9600);
     while (!Serial)
    {
    ; // wait for serial port to connect.
    }
    Serial.println("set phone number");
}
void loop()
{
  if(!Serial.available()&&enable)
  {
    numberortext=~numberortext;
    enable=0;
  }
  if(Serial.available())
  {
    mySerial.write(Serial.read()); //send data to Arduino SMS App
    if(numberortext&&!enable)
    {
      Serial.println("set phone number");
    }
    if(!numberortext&&!enable)
    {
      Serial.println("set SMS text");
    }
     enable=1;
  }
}