Skip to content

Instantly share code, notes, and snippets.

@vlrmprjct
Created January 25, 2023 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vlrmprjct/03c0880d5bfde470878fe9a12473a8eb to your computer and use it in GitHub Desktop.
Save vlrmprjct/03c0880d5bfde470878fe9a12473a8eb to your computer and use it in GitHub Desktop.
Arduino
boolean delayTime(unsigned long time) {
static unsigned long previousmillis = 0;
unsigned long currentmillis = millis();
if (currentmillis - previousmillis >= time) {
previousmillis = currentmillis;
return true;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment