#include "FastLED.h" // FastLED library. #if FASTLED_VERSION < 3001000 #error "Requires FastLED 3.1 or later; check github for latest code." #endif //This is where we adjust things to match our unique project: #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 SATURATION 255 // 0-255, 0 is pure white, 255 is fully saturated color #define BUTTON_PIN 2 // Connect the button to GND and one of the pins. #define UPDATES_PER_SECOND 100 //CRGB leds[NUM_LEDS]; CRGBArray leds; //------------------SETUP------------------ void setup() { delay( 2000 ); // power-up safety delay // 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 ); pinMode(BUTTON_PIN, INPUT_PULLUP); } void loop() { for(int i = 0; i < 3; i++){ Red_light(); FastLED.delay(4000); Yellow_light(); FastLED.delay(1500); fill_black(); green_light(); FastLED.delay(5000); fill_black(); Yellow_light(); FastLED.delay(2000); fill_black(); } } void Red_light() { leds(0,NUM_LEDS/3-1).fill_solid(CRGB(250,0,0)); } void Yellow_light() { leds(NUM_LEDS/3,NUM_LEDS/3*2-1).fill_solid(CRGB(250,250,0)); } void green_light() { leds(NUM_LEDS/3*2,NUM_LEDS-1).fill_solid(CRGB(0,250,0)); } void fill_black() { leds.fill_solid(CRGB(0,0,0)); }