Struggling with millis() for two tasks

What CUBE camera is that you working with?

Does it matter where the two blue 200 ms pulses come in relation to a periodic blue 500 ms pulses? That is, what happens if there is a trigger during or very near to a periodic pulse?

Does the 5 second red pulse begin immediately at the falling edge of the second blue 200 ms pulse?

When should periodic blue pulses resume after a triggered sequence blue-blue-red?

I am curious mostly, but ask because... your code will end up answering these questions, and if you don't plan ahead, the answers it comes up with may not be what you want!

HTH

a7