I am trying to extract data of Lat and Long sent by GPS module to the 8051uC.
GPS received data looks like:
$GPRMC,062637.000,A,2253.49272,N,07258.83129,E,,,270212,,,A*6970212,0.1,W,A*12
I need to write in the LCD the LAT and LONG,
I started the code by MikriC compiler from an example but sounds it is incompleted
char uart_rd;
sbit LCD_RS at P2_0_bit;
sbit LCD_EN at P2_1_bit;
sbit LCD_D4 at P2_2_bit;
sbit LCD_D5 at P2_3_bit;
sbit LCD_D6 at P2_4_bit;
sbit LCD_D7 at P2_5_bit;
char idata info[70];
char test[]="$GPGGA";
unsigned int check=0,i;
unsigned char a;
int j;
void main() {
Lcd_Init();
UART1_Init(4800); // Initialize UART module at 4800 bps,
// receiver enabled
//frame size 8 bits
//1 STOP bit
//parity mode disabled
//disabled automatic address recognition
Delay_ms(100); // Wait for UART module to stabilize
while (1) {
if (UART1_Data_Ready() == 1) { // if data is received
UART1_Read_Text(info, "$GPGGA", 10); // reads text until '$GPRMC' is found
LCD_Out(1,1,info);
} Delay_ms(1000);
}
}