Stopwatch with Pause/Lap  6 digit 7 seg LED. HELP!

Hi David,
It's just past mid January, we have another 2+months of snow to go!
The temperature is 10F (~-12, -14C) now, and its supposed to go to -10F tomorrow night - no melting going on any time soon :slight_smile:

I changed the code around some, making a memory_writing flag: 0 = no writing in process, 1 = memory writing in process, and 2 = memory writing done.
Then I put the memory writing code in it own tab, just like the memory reading code.
I put the code to read the pause button, debounce it, and control what function it did in its own tab, similar to what you had David, but with more functionality.
Doesn't work yet tho. When EEPROM writing is complete (EEPROM_writing == 2), the third part resets EEPROM_writing to 0 and then it seems to jump right back into another set of writes, so somehow it is seeing the button as having been pressed anew when it wasn't.

Well, adding the missing ='s didn't fix it, doesn't pause/write at all now...

// read the start button, 
start_button_state = digitalRead (start_button);
if (start_button_state == 0 ){
  press_time = millis();
  elapsed_presstime = press_time - old_presstime;
  if (elapsed_presstime >2000 && pause_pressed == 0)  
// meant to supply debounce time, and not currently doing any of the started actions
    pause_pressed = 1;
  Serial.println ("Start button pressed ");
  Serial.println ("Press allowed ");
  old_presstime = press_time;
}
else {
  pause_pressed = 0;
  press_state = 0;
}
// ********************************************************  
//If not running, set the running flag
if ((pause_pressed ==1) && (running == 0)){
  Serial.println ("New start!");
  running = 1;
  display_update = 1;
  press_state = 1; // starting time running
  pause_pressed = 0;
}

// ********************************************************
// Once running, see if should pause, etc.

// button read above
if ((pause_pressed == 1) && (press_state =[glow]=[/glow] 1) && (running == 1) && (EEPROM_writing == 0) ) {  // time running, 1000mS for debounce - [glow]just realized only had 1 = here too![/glow]  Serial.println ("Display paused, Time Reset, Time being Stored");
  display_update = 0;
  display_paused = 1;
  press_state = 2; // change to allow end of pause, with no new writing started

  // reset Time to 0
  currentmicros = micros();  // read the time.
  previousmicros = currentmicros;
  elapsedmicros = currentmicros - previousmicros;
  //MAKE COPIES
  copy_hundredths= hundredths;
  copy_tenths = tenths;
  copy_ones_seconds = ones_seconds;
  copy_tens_seconds = tens_seconds;
  copy_ones_minutes = ones_minutes;
  copy_tens_minutes = tens_minutes;
  EEPROM_writing = 1;
  Serial.println ("EEPROM writing enabled");

  // reset the time to 0
  hundredths = 0;
  tenths = 0;
  ones_seconds = 0;
  tens_seconds = 0;
  ones_minutes = 0;
  tens_minutes = 0;

  pause_pressed = 0; // done with all actions
}


// *************************************************************************
// if button was pressed & done writing, unpause to let time display be shown
if ((pause_pressed == 1) &&(press_state =[glow]=[/glow] 2) && (EEPROM_writing == 2)){
  //done writing, can let display updates start again - [glow]just realized only had 1 = here[/glow]  Serial.println ("Unpausing Display update");
  display_update = 1;
  display_paused = 0;
  display_paused_flag = 0;
  EEPROM_writing = 0;
  press_state = 1;  // writing is done, allow new pause to happen
  pause_pressed = 0;  // done with all actions

}