Change to reduce call to millis() by Paul Stoffregen

This commit is contained in:
Tom Igoe 2010-02-09 03:51:55 +00:00
parent 3310d7c5aa
commit 7c2b249621
1 changed files with 4 additions and 3 deletions

View File

@ -39,9 +39,10 @@ void loop()
{
// here is where you'd put code that needs to be running all the time.
// check to see if it's time to blink the LED; that is, is the difference
// between the current time and last time we blinked the LED bigger than
// the interval at which we want to blink the LED.
// check to see if it's time to blink the LED; that is, if the
// difference between the current time and last time you blinked
// the LED is bigger than the interval at which you want to
// blink the LED.
unsigned long currentMillis = millis();
if(currentMillis - previousMillis > interval) {