Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "FastLED.h"
- // How many leds in your strip?
- #define NUM_LEDS 300
- // For led chips like Neopixels, which have a data line, ground, and power, you just
- // need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
- // ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
- #define DATA_PIN 6
- #define CLOCK_PIN 13
- CRGB leds[NUM_LEDS];
- long sthalf = (NUM_LEDS/2);
- long sthalf2 = (NUM_LEDS); //THIS IS WHERE I'M HAVING TROUBLE
- void setup() {
- // Uncomment/edit one of the following lines for your leds arrangement.
- // FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);
- // FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
- // FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);
- // FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
- // FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
- FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
- // FastLED.addLeds<NEOPIXEL, DATA_PIN, RGB>(leds, NUM_LEDS);
- // FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
- // FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
- // FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);
- // FastLED.addLeds<LPD8806, RGB>(leds, NUM_LEDS);
- // FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
- // FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
- // FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
- }
- void loop(){
- fill_solid(leds, sthalf, CRGB::White);
- FastLED.show();
- delay(20);
- fill_solid(leds, NUM_LEDS, CRGB::Black);
- FastLED.show();
- delay(1000);
- fill_solid(leds, sthalf2, CRGB::White);
- FastLED.show();
- delay(20);
- fill_solid(leds, sthalf2, CRGB::Black);
- FastLED.show();
- delay(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment