How to validate a gps message; validating gps output messages by lighting an led
This is the code for extracting the desired gps code: #include #define RXB8 1 #define TXB8 0 #define OVR 3 #define FE 4 #define UDRE 5 #define RXC 7
#define FRAMING_ERROR(1<#define DATA _OVERRUN(1<#define DATA_REGISTER_EMPTY(1<#define RX_COMPLETE(1< //Get a character from the UART1 Reciever #progma used+ char getchar1(void) { char status,data; while(1)
{ while(((status=UCSR1A)&(RX_COMPLETE)==0); data=UDR1; if((status &(FRAME_ERROR|DATA_OVERRUN))==0) return data; }; } #progma used-
/* Get GGA information from the UART0 Reciever*/ void getGGAmessage(char*message){
char header7="GPGGA"; int i=-1; do{ getmessage(message,0) i=strncmp(header,message,6); } while(i !=0);
}
/* Get present GPS position*/
void getposition(char*position){ char message85 = {'\0'}; char temp15 = {'\0'}; char terminate3 = "n\0"; int num_satellites = 0; /*Get GGA(Global Positioning System Fix Data) message*/ getGGAmessage(message) /*Get Satellites used in Calculation*/ strncpyind(temp,message,((num_satellites*3)-1),11); strncat(position,temp,((num_satellites*3)-1)); strncat(posiion,terminate,2); }
How do I validate that I am getting the correct gps message using lit leds?
Click here to post comments.
Join in and write your own page! It's easy to do. How?
Simply click here to return to Ask for a Solution to your microcontroller problem.
|