1

Topic: Integrate timer feature into RemoteXY App

I am presently working on a project that requires a timer.
I would like to set time for the appliances on my home automation system to come up.
I will appreciate if you can make this update as soon as possible.
Thank you

2 (edited by Ghostwarrior 2022-07-23 02:28:54)

Re: Integrate timer feature into RemoteXY App

You didn't mention On delay or Off delay. Please describe a little bit brief
and Ex. use simply millis() function and the important is using millis() function after approximately 50 days the timer wraps round to zero.

#define EXE_INTERVAL 1000  //delay time in milli seconds(1000 = 1seconds)

unsigned long lastExecutedMillis = 0; // vairable to save the last executed time

void setup() {
  /*******************
   *  your setup code
   *******************/
}

void loop() {
  unsigned long currentMillis = millis();

  if (currentMillis - lastExecutedMillis >= EXE_INTERVAL) {
    lastExecutedMillis = currentMillis; // save the last executed time

    /******************
     * your code block
     ******************/
  }
}