#include #define NUM_STRIPS 3 #define NUM_LEDS_PER_STRIP 24 #define NUM_LEDS NUM_LEDS_PER_STRIP * NUM_STRIPS #define BRIGHTNESS 255 // 255 is full brightness, 128 is half #define MIN_BRIGHTNESS 8 // watch the power! #define MAX_BRIGHTNESS 255 // watch the power! CRGB leds[NUM_LEDS]; //reorder LEDs sequence from buttom up int db[] = {20,21,19,22,18,23,26,24,25, 9,17,10,16,11,15,12,14,13, 7,6,8,5,0,4,1,3,2}; void setup() { delay( 2000 ); // power-up safety delay //Set all lights to make sure all are working as expected // Assign pin 3, 5 and 6 as LED singal pin FastLED.addLeds(leds, 0, NUM_LEDS_PER_STRIP); FastLED.addLeds(leds, NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP); FastLED.addLeds(leds, NUM_LEDS_PER_STRIP*2, NUM_LEDS_PER_STRIP); FastLED.setBrightness( BRIGHTNESS ); //set rainbow background fill_rainbow(leds, NUM_LEDS, 0, 9); FastLED.show(); delay(1000); } void loop() { //clear background fill_solid(leds, NUM_LEDS, CRGB::Black); for(int n = 0; n < NUM_LEDS; n++) { for(int i = NUM_LEDS; i > n; i--) { leds[db[i]] = CHSV(i*5,255,255); FastLED.show(); // clear this led for the next time around the loop leds[db[i]] = CRGB::Black; delay(10); } leds[db[n]] = CHSV(n*9,255,255); FastLED.show(); } for(int i = NUM_LEDS; i > 0; i--) { leds[db[i]].fadeToBlackBy(100); FastLED.show(); } for(int i = 1800; i > 0; i--) { float breath = (exp(sin(millis()/5000.0*PI)) - 0.36787944)*108.0; breath = map(breath, 0, 255, MIN_BRIGHTNESS, MAX_BRIGHTNESS); FastLED.setBrightness(breath); FastLED.show(); delay(5); } }