Last active
October 7, 2018 23:16
-
-
Save jwhendy/8a18915f2d5658264ed98aad73d3bb2d to your computer and use it in GitHub Desktop.
How to advance leds at a set timing
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
// every second, we copy all LED values forward one pixel | |
EVERY_N_MILLISECONDS(1000) | |
{ | |
for(int i=NUM_LEDS-1; i>0; i--) | |
{ | |
leds[i] = leds[i-1] | |
} | |
leds[0] = CRGB(0, 0, 0) | |
} | |
// if it's been 3 seconds, we put a new light on the strip, setting the first pixel white | |
EVERY_N_MILLISECONDS(3000) | |
{ | |
leds[0] = CRGB(255, 255, 255) | |
} | |
FastLED.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment