Problem with modulo (%) and reset

This code is not doing the reset. The problem is that if YOU do reset
somehow during this code, the Aruino hangs and you can not do another
reset. Why should you do the reset? When you start serial from PC
it sinks the DTR and resets Arduino. So the problem is that when you have code like my example, you have good change to hang the Arduino
when you connect it thru USB from PC. And to simulate that it is much faster to just press the reset button and see what happends.

The micros is just OK for me, because millis is not accurate enough in my purpose. And dOn I admit that boolean is better in this case, but this was just a smallest peace of code from much much bigger case
where a noticed the problem and tried to minimize the problem something that is easy to repeat.

And the worst thing is that the same problem comes when some interrupt happens. And that is the main point, but I think Reset is more familiar for most people.

:wink: