it seems that the program restart again again.I mean arduino behaves like, it is automatically reset itself again again.what is the reason of it?i check power and reset button through different program and it is okay.only for this program it behaves like this.Below here i attached a photo.It will be very helpful if anyone tell me the reason of it.
CODE:
#include <SoftwareSerial.h>
SoftwareSerial mamun(2, 3); //RX is in 2, TX is in 3
int inByte = 0;
void setup()
{
mamun.begin(9600); // GSM baud rate
Serial.begin(9600);
delay(500);
Serial.print("Command start:\n\n");
delay(100);
mamun.println("AT+CMGDA="DEL READ""); //for delet all SMS
delay(1000);
mamun.println("AT+CMGF=1\r"); //Set SMS Text Mode
delay(200);
}
void loop()
{Serial.print("."); //here i use "." to understand the output behavior
if(mamun.available() >0){
inByte = mamun.read();
Serial.write(inByte);
}
}
Serial Output:
.......................................Command start:
.A.T.+.C.M.G.D.A.=.".D.E.L. .R.E.A.D.".
.
.
.
.E.R.R.O.R.
.
.A.T.+.C.M.G.F.=.1.
.
.
.
.O.K.
.
...
