Using millis () for timing. A beginners guide - Arduino Forum
It is also convenient to do this at the start of loop () and you do it like this. currentMillis = millis (); Simple enough, but this line of code embodies a number of important ideas : The variable must previously have been declared. It is an unsigned long because that is what millis () returns.
more
|