Sky_Jones

Rainbow Rows

Oct 13th, 2014
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.98 KB | None | 0 0
  1. #include "FastLED.h"
  2.  
  3. #define NUM_LEDS 100
  4.  
  5. #define DATA_PIN 6
  6.  
  7. CRGB leds[NUM_LEDS];
  8.  
  9. void setup() {
  10.     // sanity check delay - allows reprogramming if accidently blowing power w/leds
  11.     delay(2000);
  12.  
  13.       FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);
  14.      
  15. }
  16. /*      for(int Row1 = 0; Row1 < 10; Row1++)
  17.         for(int Row2 = 10; Row2 < 20; Row2++)
  18.         for(int Row3 = 20; Row3 < 30; Row3++)
  19.         for(int Row4 = 30; Row4 < 40; Row4++)
  20.         for(int Row5 = 40; Row5 < 50; Row5++)
  21.         for(int Row6 = 50; Row6 < 60; Row6++)
  22.         for(int Row7 = 60; Row7 < 70; Row7++)
  23.         for(int Row8 = 70; Row8 < 80; Row8++)
  24.         for(int Row9 = 80; Row9 < 90; Row9++)
  25.         for(int Row10 = 90; Row10 < 100; Row10++)
  26. */
  27. // add loop
  28. void loop() {
  29.  
  30.         for(int Row1 = 0; Row1 < 10; Row1++) {
  31.             leds[Row1] = CHSV( 0, 255, 255);
  32.             FastLED.show();
  33.                  }
  34. delay(1000);
  35.         for(int Row2 = 10; Row2 < 20; Row2++) {
  36.             leds[Row2] = CHSV( 32, 255, 255);
  37.             FastLED.show();
  38.                  }
  39. delay(1000);
  40.         for(int Row3 = 20; Row3 < 30; Row3++) {
  41.             leds[Row3] = CHSV( 64, 255, 255);
  42.             FastLED.show();
  43.         }
  44. delay(1000);
  45.         for(int Row4 = 30; Row4 < 40; Row4++) {
  46.             leds[Row4] = CHSV( 96, 255, 255);
  47.             FastLED.show();
  48.         }
  49. delay(1000);
  50.         for(int Row5 = 40; Row5 < 50; Row5++) {
  51.             leds[Row5] = CHSV( 128, 255, 255);
  52.             FastLED.show();
  53.         }
  54. delay(1000);
  55.         for(int Row6 = 50; Row6 < 60; Row6++) {
  56.             leds[Row6] = CHSV( 160, 255, 255);
  57.             FastLED.show();
  58.         }
  59. delay(1000);
  60.         for(int Row7 = 60; Row7 < 70; Row7++) {
  61.             leds[Row7] = CHSV( 192, 255, 255);
  62.             FastLED.show();
  63.         }
  64. delay(1000);
  65.         for(int Row8 = 70; Row8 < 80; Row8++) {
  66.             leds[Row8] = CHSV( 224, 255, 255);
  67.             FastLED.show();
  68.         }
  69. delay(1000);
  70.     }
Advertisement
Add Comment
Please, Sign In to add comment