hi.
here i want to do GSM Noticeboard.i use arduino uno r3,sim900 gsm/gprs for arduino and also 16x2 lcd display.
i want to display the receive message to the lcd.the message receive in serial monitor.but i dont know how to print the message to the lcd.its good if someone can help me or give me the code XD XD XD XD XD
Show what you have written so far? And please use code (#) tags to make it easier to read.
#include <Wire.h>
#include <LiquidCrystal.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3);
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 7, 6, 5, 4);
char inchar=0;
int ledpin = 13;
void setup()
{
mySerial.begin(9600); // the GPRS baud rat
Serial.begin(9600); // the GPRS baud rate
mySerial.println("AT");
delay(1000); // give time to log on to network.
mySerial.println("AT+CMGF=1\r");
delay(1000);
mySerial.println("AT+CNMI=2,2,0,0,0\r");
pinMode(ledpin,OUTPUT);
digitalWrite(ledpin,LOW);
lcd.begin(16, 2);
lcd.print(" AHMAD AMINULAH");
}
void loop()
{
if (mySerial.available()>0)
{
inchar=mySerial.read();
Serial.print(inchar);
}
if (Serial.available())
mySerial.write(Serial.read());
}
void clearScreen()
{
lcd.setCursor(0,0);
lcd.print(" ");
lcd.setCursor(0,1);
lcd.print(" ");
}
You need to save the characters 'inchar' as they come in from the shield and when you have them all parse the result and display on the lcd.
Given that you have a total display space of 32 characters and an SMS message can be 140 characters long how are you going to handle the extra characters?
im so sorry.but i really dont understand and how to do it.please help me
I requested that you use code tags to make your code easier to read. You ignored my request so why should I pay any further attention to yours?
What are you going to do with any sms that are longer than 32 characters?
im so sorry about the # tag. if the message is longer than 32 character then message will be discard and not display on the lcd. but right now i still dont have any idea.