Created
April 11, 2013 15:16
-
-
Save macklinu/5364219 to your computer and use it in GitHub Desktop.
arduino timer pseudocode
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
| float t_random[numLeds]; // random timer | |
| float t_reset[numLeds]; // reset timer | |
| if (millis() - t_random[i] > t_reset[i]) { // when you've surpassed a random time for an LED | |
| toggle_led[i]; // turn it on | |
| t_reset[i] = millis(); // make the reset time the current time | |
| t_random[i] = random(bottomRange, topRange); // create a new random timer value for that LED | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment