static uint32_t MillisValueLastTransition = 0; if (millis() - MillisValueLastTransition >= MY_DELAY_MS) { MillisValueLastTransition = millis(); }