Guest User

Untitled

a guest
Sep 20th, 2017
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. #include <FastLED.h>
  2.  
  3. const uint8_t Strip0Dat = 29,  
  4.               Strip0Clk = 30;
  5.  
  6. const uint8_t Strip1Dat = 31,
  7.               Strip1Clk = 32;
  8.              
  9.  
  10.  
  11. const int NumStrips = 2;
  12. const int MaxLEDS = 172;
  13.  
  14. const int TotalLEDS[NumStrips] = {172, 172};
  15.  
  16. CRGB leds[NumStrips][MaxLEDS];
  17.  
  18. void setup() {
  19.  
  20.  
  21.   FastLED.setBrightness(0);
  22.   FastLED.addLeds<APA102, Strip0Dat, Strip0Clk, BGR, DATA_RATE_MHZ(4)>(leds[0], TotalLEDS[0]);
  23.   FastLED.addLeds<APA102, Strip1Dat, Strip1Clk, BGR, DATA_RATE_MHZ(4)>(leds[1], TotalLEDS[1]);
  24.   FastLED.show();
  25.   FastLED.setBrightness(255);
  26.  
  27.    
  28.   fill_solid(leds[0], TotalLEDS[0], CHSV(0,0,140));
  29.   fill_solid(leds[1], TotalLEDS[1], CHSV(0,0,140));
  30.  
  31. }
  32.  
  33. void loop() {
  34.    
  35.     static uint8_t Brightness = 100;
  36.     Brightness++;
  37.  
  38.    
  39.     fill_solid(leds[0], TotalLEDS[0], CHSV(0,0,Brightness));
  40.     fill_solid(leds[1], TotalLEDS[1], CHSV(0,0,Brightness));
  41.    
  42.    
  43.  
  44.   FastLED.show();
  45.  
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment