Last active
August 29, 2015 14:16
-
-
Save kchristensen/25923763ccf82beb134b to your computer and use it in GitHub Desktop.
Rainbow Knight Rider for WS2812 LEDs
This file contains 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
void knightRider(uint8_t wait) { | |
uint8_t i, j, x = 1, prev = 11; | |
for (j = 0; j < 256; j++) { | |
for (i = 0; i >= -1; i = i + x) { | |
if (i == 255) | |
return; | |
if (i > PIXEL_COUNT) | |
x = -1; | |
strip.setPixelColor(i, Wheel(j)); | |
strip.setPixelColor(prev, 0); | |
strip.show(); | |
delay(wait); | |
prev = i; | |
j += 6; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment