Created
December 22, 2014 02:20
-
-
Save staceymakes/aa9d3426d35a09ef3918 to your computer and use it in GitHub Desktop.
Arduino Avoid Delay
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsigned long interval=50; // the time we need to wait | |
unsigned long previousMillis=0; | |
void setup(){ | |
} | |
void loop(){ | |
if ((unsigned long)(millis() - previousMillis) >= interval) { | |
previousMillis = millis(); | |
//go ahead and do what you need | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment