The problem I'm having is with the time portion. hundredths of a second is always showing "0" It doesn't write the time to hundredths of a second. Every search I've done has come up with no hundredths of a second time displaying anything other than zero. I am missing something? I want to use this for data logging and time stamping. My logger refreshes at every 100ms so having zeros is a problem with graphing. the graph see multiple events for the same second which just istn right. My other option is to add a timer or id . Id is simple but I cant figure out the timer to write a dataString and show the missing zero for values less than 10 eg. 9 seconds should show as :09 not :9.
Can someone point me in the right direction please?
Thanks!
why does the gps not print time to hundredths of a second (it only prints "0") never any kind time to the hundredths of a second.
If gps cant be made to display the time to the hundredth how would I make code that looks like the following print the time to a string.
elapsedTime = millis() - startTime; // store elapsed time
elapsedMinutes = (elapsedTime / 60000L); // divide by 60000 to convert to minutes - then cast to an int to print
elapsedSeconds = (elapsedTime / 1000L); // divide by 1000 to convert to seconds - then cast to an int to print
elapsedFrames = (elapsedTime / interval); // divide by 40 to convert to 1/25 of a second - then cast to an int to print
fractional = (int)(elapsedFrames % frameRate);// use modulo operator to get fractional part of 25 Frames
fractionalSecs = (int)(elapsedSeconds % 60L); // use modulo operator to get fractional part of 60 Seconds
fractionalMins = (int)(elapsedMinutes % 60L); // use modulo operator to get fractional part of 60 Minutes
if (fractionalMins < 10){ // pad in leading zeros
Serial.print("0"); // add a zero
}
Serial.print(itoa(fractionalMins, buf, 10)); // convert the int to a string and print a fractional part of 60 Minutes to the LCD
Serial.print(":"); //print a colan.
if (fractionalSecs < 10){ // pad in leading zeros
Serial.print("0"); // add a zero
}
Serial.print(itoa(fractionalSecs, buf, 10)); // convert the int to a string and print a fractional part of 60 Seconds to the LCD
Serial.print(":"); //print a colan.
if (fractional < 10){ // pad in leading zeros
Serial.print("0"); // add a zero
}
Serial.print(itoa((fractional), buf, 10)); // convert the int to a string and print a fractional part of 25 Frames to the LCD
Serial.println();
}
With your help I did figure out a timer to work. (sorry im new to arduino and don't understand how the whole sz %02d stuff works.
What is the reason behind the hundredths of a second not printing from gps? I get 7-8 readings under the same second and all the hundredths just read 0.