Advertisement
Guest User

TheFairyPanther FastLED

a guest
Oct 5th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. #define FASTLED_ALLOW_INTERRUPTS 0
  2. #include <FastLED.h>
  3. #define NUM_LEDS 600
  4. #define DATA_PIN 1
  5. #define BRIGHTNESS 255
  6. #define COLOR_ORDER RGB
  7. #define LED_TYPE WS2812B
  8. #define FADE_SCALE 252
  9. #define DELAYS 15
  10.  
  11. CRGB leds[NUM_LEDS];
  12.  
  13. void setup() {
  14. Serial.begin(57600);
  15. LEDS.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds,NUM_LEDS);
  16. LEDS.setBrightness(BRIGHTNESS);
  17. FastLED.setTemperature(ClearBlueSky );
  18. }
  19. void fadeall() { for(int i = 0; i < NUM_LEDS; i++) { leds[i].nscale8(FADE_SCALE); } }
  20. int forward = 0;
  21. void loop() {
  22. static uint8_t hue = 0;
  23. static uint8_t HueCounter = 0;
  24.  
  25. if (forward = 0){
  26. for (int H = 0; H < (NUM_LEDS/2) ;H++){
  27. leds[H] = CHSV(hue, 255, 255); leds[NUM_LEDS-H] = CHSV(hue, 255, 255); FastLED.show();
  28. hue + 0.5 ;
  29. fadeall();
  30. delay(DELAYS);
  31. if (int HueCounter = 1)
  32. { hue++;HueCounter--;}
  33. else{ HueCounter++;}
  34. forward++;
  35. }}
  36.  
  37. delay(30);
  38. hue +=20;
  39. for(int H = (NUM_LEDS)-1; H >= 0 ;H--){
  40. leds[H] = CHSV(hue, 255, 255);leds[NUM_LEDS-H] = CHSV(hue, 255, 255); FastLED.show();
  41. fadeall();
  42. delay(DELAYS);
  43. if (int HueCounter = 1)
  44. { hue++;HueCounter--;}
  45. else{ HueCounter++;}
  46. }delay(30);
  47. hue +=20;
  48. forward--;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement