Loop between a date of every month,

void loop()
{
  static int last_day = 255;
  int new_day = get_new_day();   // however you get the new day...
  
  // See if day has changed
  if (new_day != last_day)
  {
    // We know day has changed.  Now check to see if we need to reset.
    if (new_day == set_day)
    {
       // reset loop
    } 
    last_day = new_day;
  }
  
  if (set_day != new_day)
  {
    // do stuff
  }
}
1 Like