mirror of https://github.com/noisymime/Arduino.git
Change to reduce call to millis() by Paul Stoffregen
This commit is contained in:
parent
3310d7c5aa
commit
7c2b249621
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue