trungphan
Newbie level 5
- Joined
- Jun 5, 2013
- Messages
- 9
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- 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);
}
}
}
}
}
}
}
}
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);
}
}
}
}
}
}
}
}