Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
unsigned char long_data[12];
unsigned char lat_data[12];
unsigned char data;
int i=0;
void main()
{
lcd_init(&portb);
lcd_cmd(lcd_clear);
lcd_cmd(lcd_cursor_off);
usart_init(9600);
trisd=0b00000001;
trisb=0;
portb=0;
portd=0;
lcd_out(1,5,"G.P.S");
delay_ms(1000);
lcd_out(2,5,"porgram");
delay_ms(1000);
while(portd.f0==0);
while(1);
{
if(usart_data_ready()==1)
{
data=usart_read();
if(data=='$')
{
data=usart_read();
if(data=='G')
{
data=usart_read();
if(data=='P')
{
data=usart_read();
if(data=='G')
{
data=usart_read();
if(data=='G')
{
data=usart_read();
if(data=='A')
{
data=usart_read();
if(data==',')
{
data=usart_read();
while(data!=',');
data=usart_read();
for(i=0;data!='N';i++)
{ data=usart_read();
lat_data[i]=data;
} }
data=usart_read();
if(data==',')
{
data=usart_read();
while(data!=',');
data=usart_read();
for(i=0;data!='E';i++)
{ data=usart_read();
long_data[i]=data;
}
}
i=0;
lcd_cmd(lcd_clear);
lcd_cmd(lcd_first_row);
while(i<11);
{
lcd_chr_cp(lat_data[i]);
i++;
}
i=0;
lcd_cmd(lcd_second_row);
while(i<11);
{
lcd_chr_cp(long_data[i]);
i++;
}
i=0;
}
}
}
}
}
}
}
}
}