Skip to content

Instantly share code, notes, and snippets.

@indefinit
Created March 24, 2026 18:41
Show Gist options
  • Select an option

  • Save indefinit/c1b86ab07b501abd79d231540f000b3c to your computer and use it in GitHub Desktop.

Select an option

Save indefinit/c1b86ab07b501abd79d231540f000b3c to your computer and use it in GitHub Desktop.
Arduino triggering an event
unsigned long lastTime = 0;
void loop() {
if (millis() - lastTime > 1000) {
Serial.println("One second has passed!");
lastTime = millis();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment