Microcontroller › Arduino › GSM Display system using arduino
- This topic has 1 reply, 2 voices, and was last updated 6 years ago by Hari Prasaath K.
-
AuthorPosts
-
February 18, 2016 at 9:34 am #4302SachinParticipant
Dear sir,
I have modified the code attached because initially it wasn’t working.
Still it is not working i.e. the message send through gsm module is not displaying on LCD but it showing on the serial monitor.
Is there any problem in reading data serially and displaying??
According to your code the string is in # and *???
Please help me out….
Resolve the issue.
Thanks and Regards
Sachin Telgote
code as
#include <SoftwareSerial.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
SoftwareSerial mySerial(7,;
int led=13;
int temp=0,i=0,x=0,k=0;
char str[100],msg[32];
void setup()
{
lcd.begin(16,2);
Serial.begin(9600);
mySerial.begin(9600);
pinMode(led, OUTPUT);
digitalWrite(led, HIGH);
lcd.setCursor(0,0);
lcd.print("GSM Initilizing…");
gsm_init();
lcd.print("Wireless Notice");
lcd.setCursor(0,1);
lcd.print(" Board ");
delay(2000);
lcd.clear();
lcd.print("Forklift");
delay(1000);
lcd.setCursor(0,1);
lcd.print("Communication");
mySerial.println("AT+CNMI=2,2,0,0,0"); // AT Command to recieve a live SMS
delay(1000);
mySerial.println("AT+CMGF=1"); // AT Command to recieve a live SMS
delay(1000);
mySerial.println("AT+CPMS='SM' "); // AT Command to recieve a live SMS
delay(1000);
mySerial.println("AT+CMGL= 'ALL' "); // AT Command to recieve a live SMS
delay(1000);
mySerial.println("AT+CMGR=2"); // AT Command to recieve a live SMS
delay(1000);
mySerial.println("AT+CMGD=2"); // AT Command to recieve a live SMS
delay(1000);
digitalWrite(led, LOW);
}
void loop()
{
for(unsigned int t=0;t<10000;t++)
{
serialEvent();
if(temp==1)
{
x=0,k=0,temp=0;
while(x<i)
{
while(str[x]=='#')
{
x++;
while(str[x]!='*')
{
msg[k++]=str[x++];
Serial.print( msg[k++]);
}
}
x++;
msg[k]='