read data from GPS01 to dislay lcd

Status
Not open for further replies.

trungphan

Newbie level 5
Joined
Jun 5, 2013
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,344
Hi everyone!
I'm doing project about GPS. I use GPS 01 module communicate with pic16f887.
I don't data display on lcd(lcd 16x2) :sad:.
Can you help me find out error my project?
Thanks
my code:
while(1)
{

value = uart_getc();
while(value);
if(value=='$')
{
value = uart_getc();
if(value=='G')
{
value = uart_getc();
if(value=='P')
{
value = uart_getc();
if(value=='G')
{
value = uart_getc();
if(value=='G')
{
value = uart_getc();
if(value=='A')
{
value = uart_getc();
if(value==',')
{
value = uart_getc();
while(value!=',')
{
value=uart_getc();
}
lati_value[0]=uart_getc();
value = lati_value[0];
for(i=1;value!=',';i++)
{
lati_value=uart_getc();
value=lati_value;
}
lati_dir=uart_getc();
value=uart_getc();
while(value!=',')
{
value=uart_getc();
}
longi_value[0]=uart_getc();
value=longi_value[0];
for(i=1;value!=',';i++)
{
longi_value=uart_getc();
value=longi_value;
}
longi_dir=uart_getc();
lcd_putc(0x01);
__delay_ms(1);
lcd_putc(0x80);
delay_100ms(10);
i = 0;
while(lati_value!='\0')
{
lcd_puts(lati_value);
i++;
}
lcd_puts(lati_dir);
lcd_putc(0xC0);
__delay_ms(100);
i = 0;
while(longi_value!='\0')
{
lcd_puts(longi_value);
i++;
}
lcd_puts(longi_dir);
RC7 = 0;
delay_100ms(10);

}
}
}
}
}
}
}
}
 


Code C - [expand]
1
2
value = uart_getc();
while(value);



If data is received and value becomes true then your code doesn't do anything other than infinitely looping in the while(value); loop. No other code is executed.
 

As wrote by jayanth....this change is required..... while(value ) is not required......Apart from that its better to get the complete string first and then select respective string from full string.
 

How do to display data of gps up lcd? who completed this project, please you can share for me?I'm need it.
Thanks!
 

Find the attached code below I have done it for different microcontroller..
Certainly it will help you............
 

Attachments

  • lcdgps.txt
    4.3 KB · Views: 78

Thanks amitjagtap!
I completed it. Now, I want display data longitude and latitude on google, I must how to do it?
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…