Hey Everyone,
I'm working on sending and receiving texts on SIM300 interfacing it with an arduino uno.The sending bit and the subsequent display on an LCD screen has been performed sucessfully.However,I'm facing issues with the receiving bit while communicating with the GSM modem using an arduino. Meaning,I'm able to read the received texts by typing in AT commands on the hyperTermminal window but not so on the serial monitor.On the serial monitor i see a meaningless display of numbers and symbols.
My code and screen shots of my serial monitor window for receiving sms onto the SIM300 are enclosed here.
http://s1284.photobucket.com/user/sandycook9211/media/Screenshot9_zps68f9539d.png.html
Kindly assist me in this project!
I'm working on sending and receiving texts on SIM300 interfacing it with an arduino uno.The sending bit and the subsequent display on an LCD screen has been performed sucessfully.However,I'm facing issues with the receiving bit while communicating with the GSM modem using an arduino. Meaning,I'm able to read the received texts by typing in AT commands on the hyperTermminal window but not so on the serial monitor.On the serial monitor i see a meaningless display of numbers and symbols.
My code and screen shots of my serial monitor window for receiving sms onto the SIM300 are enclosed here.
Rich (BB code):
#include <SoftwareSerial.h>
SoftwareSerial mySerial(9,10);
char incomingByte=0;
void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
pinMode(13, OUTPUT);
mySerial.println("AT");
delay(2000);
mySerial.println("AT+CMGF=1");
delay(2000);
mySerial.println("AT+CSMP=17,167,0,0");
//mySerial.println("AT+CNMI=3,3,0,0");
delay(2000);
}
void loop()
{
mySerial.write("AT+CMGL=");
mySerial.write(34);
mySerial.write("ALL");
mySerial.write(34);
mySerial.write(13);
mySerial.write(10);
while (mySerial.available() > 0)
{
incomingByte = mySerial.read();
if(incomingByte!='/n')
{
Serial.print(incomingByte);
}
if(incomingByte=='/n')
{
Serial.println(incomingByte);
}
}
}
Kindly assist me in this project!