Here is the code :
#include <SoftwareSerial.h> //Include the NewSoftSerial library to send serial commands to the cellular module.
#include <string.h> //Used for string manipulations
char incoming_char=0; //Will hold the incoming character from the Serial Port.
SoftwareSerial cell(2,3); //Create a 'fake' serial port. Pin 2 is the Rx pin, pin 3 is the Tx pin.
int on=5;void setup()
{
pinMode(on,OUTPUT);
//Initialize serial ports for communication.
Serial.begin(115200);
cell.begin(115200);
Serial.println("Starting GSM Communication...");
}void loop()
{//Making GSM Module ON
delay(500);
digitalWrite(on,HIGH);
delay(7000);
digitalWrite(on,LOW);while(1)
{
//If a character comes in from the cellular module...
if(cell.available() >0)
{
incoming_char=cell.read(); //Get the character from the cellular serial port.
Serial.print(incoming_char); //Print the incoming character to the terminal.
}
//If a character is coming from the terminal to the Arduino...
if(Serial.available() >0)
{
incoming_char=Serial.read(); //Get the character coming from the terminal
cell.print(incoming_char); //Send the character to the cellular module.
}
}}
I'm then using a terminal program to view my serial data.
Thnks for the reply