achrafarhca
New Member
Hello all,
I want to read a GPS frame with an RS232 port. I use the calculator as a PIC 18F4550.
This frame contains : $ GPGGA, 115539.000,3134.6700, N, 07421.4652, E, 1,04,2.4,209.7, M, -37.5, M,, 0000 * 75.
I want to retrieve just the hour, laltitude and longitude. how I will cut this frame using mikroC?
I tried, but no results, here is the program:
I want to read a GPS frame with an RS232 port. I use the calculator as a PIC 18F4550.
This frame contains : $ GPGGA, 115539.000,3134.6700, N, 07421.4652, E, 1,04,2.4,209.7, M, -37.5, M,, 0000 * 75.
I want to retrieve just the hour, laltitude and longitude. how I will cut this frame using mikroC?
I tried, but no results, here is the program:
Code:
char uart_rd[42];
void main() {
ADCON1 |= 0x0F; // Configure AN pins as digital
CMCON |= 7;
UART1_Init(9600); // Initialize UART module at 9600 bps
Delay_ms(100); // Wait for UART module to stabilize
UART1_Write_Text("Start");
UART1_Write(10);
UART1_Write(13);
do { // Endless loop
if (UART1_Data_Ready()) { // If data is received,
UART1_Read_Text(uart_rd, "OK",42); // reads text until 'OK' is found
UART1_Write_Text(uart_rd);
}
} while (1);
}