Question on EVERY_N_MILLISECONDS(N) function.

Question on EVERY_N_MILLISECONDS(N) function.

Is it not possible to change this number on the fly or is the number defined when compiling going to stay constant? If it can’t be changed on the fly, does anyone have an example using something similar to this that can be changed?

Yes, you can use a changing variable so the timing can change if you set it up like this:

EVERY_N_SECONDS_I( timingObj, 10) {
// defaults to every 10 seconds, but this command
// will change the period to a random number
// of seconds from 5 to 25:
timingObj.setPeriod( random8( 5, 25) );

// … now do whatever…
// …
}

https://plus.google.com/+NOLAMike/posts/ZQhK2uWbt7R

@marmil Thanks Marc. Sorry for not using the search function before posting.

Thanks, Marc!