Advertisement
Guest User

FastLED with 2x different Strips

a guest
Jan 9th, 2020
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <FastLED.h>
  2.  
  3. #define LED_STRIP_PIN     14
  4. #define STRIP_NUM_LEDS    5
  5. CRGB strip[STRIP_NUM_LEDS];
  6.  
  7. #define LED_RING_PIN     10
  8. #define RING_NUM_LEDS    12
  9. CRGB ring[RING_NUM_LEDS];
  10.  
  11. #define BRIGHTNESS  64
  12. #define LED_TYPE    WS2812
  13. #define COLOR_ORDER GRB
  14.  
  15.  
  16. void setup() {
  17.   // put your setup code here, to run once:
  18.  
  19.    FastLED.addLeds<NEOPIXEL, LED_STRIP_PIN>(strip, STRIP_NUM_LEDS);
  20.    FastLED.addLeds<NEOPIXEL, LED_RING_PIN>(ring, RING_NUM_LEDS);
  21. }
  22.  
  23. void loop() {
  24.   // put your main code here, to run repeatedly:
  25.   for (int i=0; i<RING_NUM_LEDS*STRIP_NUM_LEDS; i++){
  26.     strip[i % STRIP_NUM_LEDS]= CRGB::Red;
  27.     ring[i % RING_NUM_LEDS]= CRGB::Red;
  28.     FastLED.show();
  29.     strip[i % STRIP_NUM_LEDS]= CRGB::Black;
  30.     ring[i % RING_NUM_LEDS]= CRGB::Black;
  31. delay(100);    
  32.   }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement