How to achieve a repeat function that can be stopped

I apologize for my lack of understanding, I am trying to figure out how to do the following:

condition 1:
play a condition1.wav file and repeat it ever 10 minutes.
condition 2: stop repeat of condition 1 and play condition2.wav every 10 minutes
condition3: Same as above but play condition3.wav
condition4: stop all repeated playback, unless condition 1 or 2 or 3 are met.
Is there any way to achieve this?
Thank you in advance.

Yes.

void loop()
{
  static unsigned long startTime = 0;

  if (millis() - startTime >= 600000ul) // Ten minutes
  {
    switch (condition)
    {
    case 1:  PlayFile1(); break;
    case 2:  PlayFile2(); break;
    case 3:  PlayFile3(); break;
    }
  }
}

Very likely can be done. What determines the "conditions"?
Paul

im using if/else statements

if((ns->sensSgv<=cfg.snd_warning) && (ns->sensSgv>=0.1)) for example runs a warning state,
} else {

    if( ns->sensSgv>=cfg.snd_warning_high ) { is a alarm state

Does that compile?

Yes it does.

I have the full application running correctly. im just going back through adding in new things i want it to do

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.