Guest User

Untitled

a guest
Nov 20th, 2016
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.08 KB | None | 0 0
  1. //this is a program I wrote for a light box installation in my gloomy ass bedroom
  2. //
  3.  
  4.  
  5.  
  6.  
  7. #include "FastLED.h"            // This sketch uses the FastLED library
  8.  
  9. #define DATA_PIN 6              // Data connected to Digital Pin 6 on the Arduino
  10.  
  11. #define LED_TYPE WS2811         //this is an array of 40 in an 8X5 pattern
  12. #define NUM_LEDS 40
  13.  
  14. CRGB leds[NUM_LEDS];
  15.  
  16. void setup() {
  17.     // sanity check delay - allows reprogramming if accidently blowing power w/leds
  18.     delay(2000);
  19.     LEDS.addLeds<LED_TYPE, DATA_PIN, RGB>(leds, NUM_LEDS);
  20. }
  21.  
  22. void loop() {
  23.  
  24. fill_solid(leds, NUM_LEDS, CRGB ::Azure);
  25.    // Move a single white led in its own row
  26. //   for(int Row1 = 0; Row1 < 8; Row1 = Row1 + 1) for(int row2 = 8; row2 <16; row2 = row2 +1) {
  27.     //   leds[Row1] = CRGB::White; leds[row2] = CRGB :: White;}
  28.   //   delay(1000);
  29.   //    FastLED.show();
  30. //same as above but now it turns them off
  31.    for(int Row1 = 0; Row1 < 8; Row1 = Row1 + 1) for(int row2 = 8; row2 <16; row2 = row2 +1)
  32.     {leds[Row1] = CRGB ::Black; leds[row2] = CRGB ::Black;}
  33.     delay(1000);
  34.       FastLED.show();
Advertisement
Add Comment
Please, Sign In to add comment