Created
November 7, 2018 01:23
-
-
Save kbostick88/d365cafd3d3f8b1cecc3a3baf3d4a3e6 to your computer and use it in GitHub Desktop.
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
if (setEffect == "Red Green White Loop") { | |
static uint8_t startIndex = 0; | |
startIndex = startIndex + 1; /* higher = faster motion */ | |
Serial.print("x"); | |
// First slide the led in one direction | |
for(int i = 0; i < NUM_LEDS; i++) { | |
// Set the i'th led to red | |
leds[i] = CRGB(255, 0, 0); | |
// Show the leds | |
FastLED.show(); | |
// now that we've shown the leds, reset the i'th led to black | |
// leds[i] = CRGB::Black; | |
//fadeall(); | |
// Wait a little bit before we loop around and do it again | |
delay(40); | |
} | |
for(int i = (NUM_LEDS)-1; i >= 0; i--) { | |
// Set the i'th led to red | |
leds[i] = CRGB(0, 255, 0); | |
// Show the leds | |
FastLED.show(); | |
// now that we've shown the leds, reset the i'th led to black | |
// leds[i] = CRGB::Black; | |
//fadeall(); | |
// Wait a little bit before we loop around and do it again | |
delay(40); | |
} | |
for(int i = 0; i < NUM_LEDS; i++) { | |
// Set the i'th led to red | |
leds[i] = CRGB(255, 255, 255); | |
// Show the leds | |
FastLED.show(); | |
// now that we've shown the leds, reset the i'th led to black | |
// leds[i] = CRGB::Black; | |
//fadeall(); | |
// Wait a little bit before we loop around and do it again | |
delay(40); | |
} | |
for(int i = (NUM_LEDS)-1; i >= 0; i--) { | |
// Set the i'th led to red | |
leds[i] = CRGB(0, 255, 0); | |
// Show the leds | |
FastLED.show(); | |
// now that we've shown the leds, reset the i'th led to black | |
// leds[i] = CRGB::Black; | |
//fadeall(); | |
// Wait a little bit before we loop around and do it again | |
delay(40); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment