Using frequency of recieving messages from GPS module as time reference


i need calculate time passed 24h, maximum error, let's 0.5%. millis() accurate enough (or not?) in code, more convenient use frequency of receiving messages form gps module uart (1hz). assuming "catch" data in main loop, process need , skip rest (whole thing taking less 1 second), incrementing variable every time data available give me number of seconds passed. example code:

code: [select]

setup() {
  //......
  serial.settimeout(20);
}
loop() {
  if(serial.available()) {
    secondspassed++;
    //do data on serial
    char tmp;
    while (serial.readbytes(tmp, 1)) {}; //skip rest of data in current gps message
  }
}



how accurate be?
gps module neo-6m

is there reason why don't want use gps time information? gps units used in stationary project in order make use of time output.

i bet 1hz output frequency reliable won't better gps time data.


Arduino Forum > Using Arduino > Project Guidance > Using frequency of recieving messages from GPS module as time reference


arduino

Comments