I ran into EVERY_N_SECONDS() and related macros (in lib8tion.h),

I ran into EVERY_N_SECONDS() and related macros (in lib8tion.h), and have been using it successfully, but I’d like it to run immediately when my program starts, instead of waiting n seconds until the first firing. I could pull the code into a function and call it both from setup() and EVERY_N_SECONDS(), but it would be nice if there were a way to have it fire on the first pass thru loop(). Any suggestions or tricks?

Could you use the EVERY_N_MILLIS_I form where you can change the timer, and start with it at 0 or 1 ms and then immediately update it to your preferred timing?

Ryan’s suggestion is a good one I’ve used several times. Here’s an example of using EVERY_N_MILLIS_I, not using Ryan’s suggestion, but just use in general. (Look in bottom part of main loop).

EVERY_N_MILLIS_I , thats exactly what I’ve needed - thx !

Thanks, that’s a nice clean solution.