Switch with different delays

delchrys:
Would not use delay function, because when it is running in normal mode it won't switch to test mode if the 12 hours delay isn't elapsed.

That is indeed a great point :wink:

But what about in the loop

if(digitalRead(SwitchPin)){
  delay = 1 * 1000UL;
}
else{
  delay = 12 * 60 * 1000UL;
}

But most of the time I don't care to change it on the fly. I just recompile it to have the right time in it after debugging. And to make it easy I do something like

///#define MY_DEBUG //Uncomment to enter debug mode

#if defined(MY_DEBUG)
const unsigned long Delay = 1 * 1000UL;
#else
const unsigned long Delay = 12 * 60  1000UL;
#endif

I use the same construction to print or not print debug info via serial.