Skip to content

Instantly share code, notes, and snippets.

@mgruben
Created September 6, 2020 18:43
Show Gist options
  • Save mgruben/ed17f080224ad7e8d3bc3002b5644742 to your computer and use it in GitHub Desktop.
Save mgruben/ed17f080224ad7e8d3bc3002b5644742 to your computer and use it in GitHub Desktop.
unsigned long previous = 0;
// Set this to the desired delay in ms
const unsigned long DELAY;
void loop() { unsigned long now = millis();
if (now - previous > DELAY) {
// Fire our event
previous = now;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment