Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // FastLED
- #include <FastLED.h>
- #define NUM_LEDS 60
- #define DAT_PIN 2
- #define TAIL_LENGTH 32
- int COLOR_POS = 10;
- CRGB leds[NUM_LEDS];
- void setup() {
- FastLED.addLeds<NEOPIXEL, DAT_PIN>(leds, NUM_LEDS);
- }
- void loop() {
- // Changing COLOR Loop
- for(int COLOR = 0; COLOR < 255; COLOR = COLOR + 35) {
- // Changing LED Loop
- for(int POS = 0; POS < NUM_LEDS; POS++){
- leds[POS] = CHSV(COLOR, 255, 255);
- FastLED.show();
- //Code to change LED cover depending on current position of the LED
- if (POS > COLOR_POS ){
- COLOR = COLOR + 70;
- COLOR_POS = COLOR_POS + 10;
- } else if (COLOR_POS >= 70) {
- COLOR_POS = 10;
- }
- //Fading loop
- for(int fade = 0; fade < NUM_LEDS; fade++) {
- leds[fade].fadeToBlackBy(TAIL_LENGTH);
- delay(01);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment