Guest User

Untitled

a guest
Jan 27th, 2014
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. //********************** LED TRAIL ***************************
  2. for (int black = 0; black < NUM_LEDS; black++) {
  3. leds[black] = CRGB::Black;
  4. }
  5. FastLED.show(); // turn LED'S off
  6. LEDS.setBrightness(255); //last setting for brightness was 0 = off. Turning back on.
  7. delay(1000);
  8. int start = 0; //counter for 50 LED's
  9. // turns the first three LED's to hot pink sequentially
  10. while(start < 3){
  11. leds[start] = CRGB::HotPink;
  12. FastLED.show();
  13. start ++;
  14. delay (200);
  15. }
  16. //Sets 3 blue and 3 pink to go down the line and continually form
  17. while (start < NUM_LEDS){ //at beginning, start = 3
  18. for (int trio = 0; trio < 18; trio = trio + 2){ //method to reform every LED as the 3 LED's progress down line
  19. if((start - (trio*3) -2) > 0){
  20. leds[start - (trio*3)] = CRGB::HotPink;
  21. leds[start - (trio*3) - 1] = CRGB::HotPink;
  22. leds[start - (trio*3) - 2] = CRGB::HotPink;
  23. if(((start - 3) - (trio*3) -2) >= 0){
  24. leds[(start - 3) - (trio*3)] = CRGB::Teal;
  25. leds[(start - 3) - (trio*3) -1] = CRGB::Teal;
  26. leds[(start - 3) - (trio*3) -2] = CRGB::Teal;
  27. }
  28. if(start == 3) leds[0] = CRGB::Teal;
  29. if(start == 4) leds[1] = CRGB::Teal;
  30. }
  31. }
  32. FastLED.show();
  33. start ++; //now do for loop again with next value of start
  34. delay (100);
  35. }
Advertisement
Add Comment
Please, Sign In to add comment