Advertisement
kartonman

blue gradient

Aug 31st, 2021
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. #include <FastLED.h>
  2.  
  3. #define NUM_LEDS 18
  4. #define LED_PIN 2
  5.  
  6. CRGB leds[NUM_LEDS];
  7.  
  8. uint8_t paletteIndex = 0;
  9.  
  10. CRGBPalette16 purplePalette = CRGBPalette16 (
  11. CRGB::DarkViolet,
  12. CRGB::DarkViolet,
  13. CRGB::DarkViolet,
  14. CRGB::DarkViolet,
  15.  
  16. CRGB::Magenta,
  17. CRGB::Magenta,
  18. CRGB::Linen,
  19. CRGB::Linen,
  20.  
  21. CRGB::Magenta,
  22. CRGB::Magenta,
  23. CRGB::DarkViolet,
  24. CRGB::DarkViolet,
  25.  
  26. CRGB::DarkViolet,
  27. CRGB::DarkViolet,
  28. CRGB::Linen,
  29. CRGB::Linen
  30. );
  31.  
  32. void setup() {
  33. FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS);
  34. FastLED.setBrightness(50);
  35. }
  36.  
  37. void loop() {
  38. fill_palette(leds, NUM_LEDS, paletteIndex, 255 / NUM_LEDS, purplePalette, 255, LINEARBLEND);
  39.  
  40. EVERY_N_MILLISECONDS(10){
  41. paletteIndex++;
  42. }
  43.  
  44. FastLED.show();
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement