hi! have started working on arduino project because thought going easy since there 1 article can refer codes, turned out disaster after have discovered different library working on sim900. article read used arduino uno, arduino gsm shield , lcd(16x2). used arduino uno, sim900 gsm shield , lcd (16x2), knowing sim900 gsm shield same arduino gsm shield not, different code must used. problem im not codes. project aims receive message via sim900 gsm shield , display on lcd. lcd must contain date , time of message @ 1st row of lcd , message in 2nd row. maximize message can read in lcd, scrolling text function in second row must applied more characters can read. lastly, 1 mobile station number or cellphone number can access gsm shield. no other people can use prank. if can provide me codes need, please , thank you.
so far, have accomplished. using software serial , lcd library.
it displays 16 characters of message in first row. not display date , time, not scroll, , not block other mobile station number.
so far, have accomplished. using software serial , lcd library.
it displays 16 characters of message in first row. not display date , time, not scroll, , not block other mobile station number.
code: [select]
#include <liquidcrystal.h>
#include <softwareserial.h>
liquidcrystal lcd(12, 11, 5, 4, 3, 2);
softwareserial sim900(7, 8 );
int inbyte=0;
void setup()
{
serial.begin(19200); // serial monitor display
sim900.begin(19200); // gsm shield start serial programming
lcd.begin(16, 2);
lcd.print(" attention");
lcd.setcursor(0, 1);
lcd.print("read message");
delay(20000); // give time manually power on gsm shield andconnect network
sim900.print("at+cmgf=1\r"); // set sms mode text
delay(100);
sim900.print("at+cnmi=2,2,0,0,0\r"); // configuration extract content of received message.display on arduino serial monitor
delay(100);
}
void loop()
{
// display text gsm shield sends out on serial monitor
do
{
while ( !sim900.available() );
} while ( '"' != sim900.read() );
do
{
while ( !sim900.available() );
} while ( '"' != sim900.read() );
do
{
while ( !sim900.available() );
} while ( '"' != sim900.read() );
do
{
while ( !sim900.available() );
} while ( '"' != sim900.read() );
do
{
while ( !sim900.available() );
} while ( '"' != sim900.read() );
do
{
while ( !sim900.available() );
} while ( '"' != sim900.read() );
while ( !sim900.available() );
inbyte = sim900.read();
while ( !sim900.available() );
inbyte = sim900.read();
lcd.clear();
while(1)
{
while ( !sim900.available() );
inbyte = sim900.read();
if ( inbyte == '\r' )
break;
else;
serial.write(inbyte);
lcd.write ( inbyte );
}
}
Arduino Forum > Using Arduino > Project Guidance > GSM shield msg to LCD. help with codes!
arduino
Comments
Post a Comment