Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //********************** LED TRAIL ***************************
- for (int black = 0; black < NUM_LEDS; black++) {
- leds[black] = CRGB::Black;
- }
- FastLED.show(); // turn LED'S off
- LEDS.setBrightness(255); //last setting for brightness was 0 = off. Turning back on.
- delay(1000);
- int start = 0; //counter for 50 LED's
- // turns the first three LED's to hot pink sequentially
- while(start < 3){
- leds[start] = CRGB::HotPink;
- FastLED.show();
- start ++;
- delay (200);
- }
- //Sets 3 blue and 3 pink to go down the line and continually form
- while (start < NUM_LEDS){ //at beginning, start = 3
- for (int trio = 0; trio < 18; trio = trio + 2){ //method to reform every LED as the 3 LED's progress down line
- if((start - (trio*3) -2) > 0){
- leds[start - (trio*3)] = CRGB::HotPink;
- leds[start - (trio*3) - 1] = CRGB::HotPink;
- leds[start - (trio*3) - 2] = CRGB::HotPink;
- if(((start - 3) - (trio*3) -2) >= 0){
- leds[(start - 3) - (trio*3)] = CRGB::Teal;
- leds[(start - 3) - (trio*3) -1] = CRGB::Teal;
- leds[(start - 3) - (trio*3) -2] = CRGB::Teal;
- }
- if(start == 3) leds[0] = CRGB::Teal;
- if(start == 4) leds[1] = CRGB::Teal;
- }
- }
- FastLED.show();
- start ++; //now do for loop again with next value of start
- delay (100);
- }
Advertisement
Add Comment
Please, Sign In to add comment