vead
Full Member level 5
I was searching about 8051 gps programming. I don't understand latitude and longitude. I found this link https://www.electronicshub.org/interfacing-gps-8051-microcontroller/
I don't understand what's happening in these two function
I don't understand what's happening in these two function
Code:
void gps ()
{
unsigned int LAT[9], LON[10];
unsigned char Temp, i;
if (rx_data() == ‘$’)
{
if( rx_data() == ‘G’)
{
if (rx_data() == ‘P’)
{
if (rx_data() == ‘R’)
{
if (rx_data() == ‘M’)
{
if (rx_data() == ‘C’)
{
while (rx_data() != ‘,’);
while (rx_data() != ‘,’);
Temp = rx_data(); /*checking for “A” condition*/
if (Temp == ‘A’||Temp == ‘V’)
{
while (rx_data() != ‘,’);
LCDCmd (0x80); /*latitude values*/
for (i=0; i<9; i++)
{
LAT[i] = rx_data();
LCDData (LAT[i]);
}
while (rx_data() != ‘,’);
while (rx_data() != ‘,’);
LCDCmd (0xc0); /*longitude values*/
for (i=0; i<10; i++)
{
LON[i] = rx_data();
LCDData (LON[i]);
}
}
}
}
}
}
}
}
}