Advertisement
Guest User

Untitled

a guest
Oct 19th, 2020
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #include <FastLED.h>
  2.  
  3. #define NUM_LEDS 60 /* The amount of pixels/leds you have */
  4. #define DATA_PIN 7 /* The pin your data line is connected to */
  5. #define LED_TYPE WS2812B /* I assume you have WS2812B leds, if not just change it to whatever you have */
  6. #define BRIGHTNESS 255 /* Control the brightness of your leds */
  7. #define SATURATION 255 /* Control the saturation of your leds */
  8.  
  9. CRGB leds[NUM_LEDS];
  10.  
  11. void setup() {
  12. FastLED.addLeds<LED_TYPE, DATA_PIN>(leds, NUM_LEDS);
  13. }
  14.  
  15. void loop() {
  16. for (int j = 0; j < 255; j++) {
  17. for (int i = 0; i < NUM_LEDS; i++) {
  18. leds[i] = CHSV(i - (j * 2), BRIGHTNESS, SATURATION); /* The higher the value 4 the less fade there is and vice versa */
  19. }
  20. FastLED.show();
  21. delay(25); /* Change this to your hearts desire, the lower the value the faster your colors move (and vice versa) */
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement