aamir shabbir
Member
Guyz im trying to interface sim908 with arduino uno the problem is when i send AT to sim908 the output should be OK but when i check the output with serial available and check it on serial monitor the serial monitor shows a series of AT and OK AT and OK continuously and the code doesnot get out of the loop of serial available what might be the problem please guide me i tried a lot but could not figure it out
This is the code for reference
#include <SoftwareSerial.h>
int ledPin = 13; // select the pin for the LED
void setup()
{
Serial.begin(115200);
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW);
delay(1500);
Serial.println("AT");
delay(1500);
}
void loop()
{
while (Serial.available())
{
char inChar = (char)Serial.read();
Serial.write(inChar);
}
And this is the output:
AT
AT
OK
AT
OK
OK
AT
OK
OK
OK
AT
OK
OK
OK
OK
AT
OK
OK
OK
OK
OK
AT
OK
OK
OK
OK
OK
OK
AT
OK
OK
OK
OK
OK
OK
OK
AT
OK
OK
OK
OK
OK
OK
OK
OK
AT
OK
OK
OK
OK
OK
OK
OK
OK
OK
AT
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
AT
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
AT
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
AT
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
AT
OK
OK
OK
OK
This is the code for reference
#include <SoftwareSerial.h>
int ledPin = 13; // select the pin for the LED
void setup()
{
Serial.begin(115200);
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW);
delay(1500);
Serial.println("AT");
delay(1500);
}
void loop()
{
while (Serial.available())
{
char inChar = (char)Serial.read();
Serial.write(inChar);
}
And this is the output:
AT
AT
OK
AT
OK
OK
AT
OK
OK
OK
AT
OK
OK
OK
OK
AT
OK
OK
OK
OK
OK
AT
OK
OK
OK
OK
OK
OK
AT
OK
OK
OK
OK
OK
OK
OK
AT
OK
OK
OK
OK
OK
OK
OK
OK
AT
OK
OK
OK
OK
OK
OK
OK
OK
OK
AT
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
AT
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
AT
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
AT
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
AT
OK
OK
OK
OK
Last edited: