Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //this is a program I wrote for a light box installation in my gloomy ass bedroom
- //
- #include "FastLED.h" // This sketch uses the FastLED library
- #define DATA_PIN 6 // Data connected to Digital Pin 6 on the Arduino
- #define LED_TYPE WS2811 //this is an array of 40 in an 8X5 pattern
- #define NUM_LEDS 40
- CRGB leds[NUM_LEDS];
- void setup() {
- // sanity check delay - allows reprogramming if accidently blowing power w/leds
- delay(2000);
- LEDS.addLeds<LED_TYPE, DATA_PIN, RGB>(leds, NUM_LEDS);
- }
- void loop() {
- fill_solid(leds, NUM_LEDS, CRGB ::Azure);
- // Move a single white led in its own row
- // for(int Row1 = 0; Row1 < 8; Row1 = Row1 + 1) for(int row2 = 8; row2 <16; row2 = row2 +1) {
- // leds[Row1] = CRGB::White; leds[row2] = CRGB :: White;}
- // delay(1000);
- // FastLED.show();
- //same as above but now it turns them off
- for(int Row1 = 0; Row1 < 8; Row1 = Row1 + 1) for(int row2 = 8; row2 <16; row2 = row2 +1)
- {leds[Row1] = CRGB ::Black; leds[row2] = CRGB ::Black;}
- delay(1000);
- FastLED.show();
Advertisement
Add Comment
Please, Sign In to add comment