Hi Warren,
I saw that post and all the math, then we went out & I forgot about it until just now.
Anyway,
To use millis, what you want to do is increment z here
for (int z=0; z<101; z++)
only when your lowest time increment has occurred.
Thus
if (time_running == 1) // because you've told it to based on a button push or something
{
unsigned long currentMillis = millis(); // see how long its been
if (currentMillis - previousMillis >= interval) // reached 10mS interval?
{
// save the last time we okayed time updates
previousMillis = currentMillis;
count_update_flag = 1;}
and roll your increments thru from there.
I was thinking more along these lines instead of all the math:
AB:CD.EF
Start at the top, you've reached the time interval:
if (count_update_flag == 1){
count_update_flag = 0; // reset for next pass thru
if (time == 59:59.99) {reset all to 0, set time_update flag to 1}
// which is really: if (A==5 && B==9 && C==5 && D==9 && E==9 && F==9)
if (A<5 and rest == 9:59.99){increment A, reset the lower digits, set time_update flag to 1}
if (B<9 and rest == 59.99){increment B, reset the lower digits, set time_update flag to 1}
if (C<5 and rest == 9.99){increment C, reset the lower digits, set time_update flag to 1}
if (D<9 and rest == 99){increment D, reset the lower digits, set time_update flag to 1}
if (E<5 and F==9){increment E, reset F, set time_update flag to 1}
if (F<9){all that's remaing, eh? increment F, set time_update flag to 1}
}// end of counting update
if (time_update == 1){
time_upate = 0; // reset for next pass thru
shift out the digits that were updated above}
} // end of interval check
then you can get away from all the floats and converting to ints & stuff.
You've got (0.01S/62.5nS) = 160,000 clock cycles for the 5-6 comparisons and the resets and the 6 shiftouts, which all be done well before the next 10mS comparison is due.