LED profile switching

I have these two sketches made for my addressable LED strip that I would like to automatically switch back and forth.

The first “profile” (I don’t know what to refer to these settings/profiles as) is this first bit of code. I would like for this to run for 4 minutes before switching to the next profile.

#include <FastLED.h>

#define LED_PIN     5
#define NUM_LEDS    12
#define BRIGHTNESS  255
#define LED_TYPE    NEOPIXEL
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];
/////////////////////////////
/////////// Speed ///////////
#define UPDATES_PER_SECOND 36
/////////////////////////////
CRGBPalette16 currentPalette;
TBlendType    currentBlending;

extern CRGBPalette16 Preset;
extern const TProgmemPalette16 Preset_p PROGMEM;


void setup() {
  delay( 3000 ); // power-up safety delay
  FastLED.addLeds<NEOPIXEL, LED_PIN>(leds, NUM_LEDS);
  FastLED.setBrightness(  BRIGHTNESS );

  currentPalette = Preset_p;
  currentBlending = LINEARBLEND;
}


void loop()
{


  static uint8_t startIndex = 0;
  startIndex = startIndex + 1;

  FillLEDsFromPaletteColors( startIndex);

  FastLED.show();
  FastLED.delay(1000 / UPDATES_PER_SECOND);
}

void FillLEDsFromPaletteColors( uint8_t colorIndex)
{
  //////////////////////////////
  uint8_t brightness = 255;
  //////////////////////////////
  for ( int i = 0; i < NUM_LEDS; i++) {
    leds[i] = ColorFromPalette( currentPalette, colorIndex, brightness, currentBlending);
    ////////////////////////////////////////////////////////////
    ///////////////// Changes the width of each color //////////
    colorIndex += 9;
    ////////////////////////////////////////////////////////////
  }
}


const TProgmemPalette16 Preset_p PROGMEM =
{ ////////////////////
  CRGB::Red,
  CRGB::Red,
  CRGB::Purple,
  CRGB::Purple,

  CRGB::Cyan,
  CRGB::Cyan,
  CRGB::Purple,
  CRGB::Purple,

  CRGB::Red,
  CRGB::Red,
  CRGB::Purple,
  CRGB::Purple,
  CRGB::Cyan,
  CRGB::Cyan,
  CRGB::Purple,
  CRGB::Purple,
  /////////////////////
};

Then the next profile I would like to run for just 1 minute, then switch back to the first, making a 5 minute loop.

#include "FastLED.h"


#define NUM_LEDS 12


#define DATA_PIN 5
#define CLOCK_PIN 13

// Define the array of leds
CRGB leds[NUM_LEDS];


void setup() { 

  	  FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
     
}

void loop() 
{

  for(int dot = 0; dot < NUM_LEDS; dot++)
 
  { 
    
    leds[dot] = CRGB::Red;
    FastLED.show();
    
    // clear this led for the next time around the loop
    leds[dot] = CRGB::Red;
    
    delay(25);
  }

    for(int dot = 0; dot < NUM_LEDS; dot++)
 
  { 
    
    leds[dot] = CRGB::Red;
    FastLED.show();
    
    // clear this led for the next time around the loop
    leds[dot] = CRGB::Purple;
    
    delay(25);
  }


for(int dot = 0; dot < NUM_LEDS; dot++)

  { 
    
    leds[dot] = CRGB::Cyan;
    FastLED.show();
    
    // clear this led for the next time around the loop
    leds[dot] = CRGB::Cyan;
    
    delay(25);
  }

  for(int dot = 0; dot < NUM_LEDS; dot++)
 
  { 
    
    leds[dot] = CRGB::Cyan;
    FastLED.show();
    
    // clear this led for the next time around the loop
    leds[dot] = CRGB::Purple;
    
    delay(25);
  }

  
}

Any help would be greatly appreciated!

Will done for using code tags. Let’s see your best attempt at merging the two sketches.

I know that they have to be put into the same sketch, So I copy/pasted the second Sketch at the bottom of the first. I know that things can’t be called by the same name (setup/loop/leds), but when I start renaming and moving the void setup/void loop around, it starts telling me that things are undefined or that it expected something before…

My coding knowledge is very (very) limited, and I don’t really know where to even start to look to get on the right path :sob:

Code merged into one sketch:

#include <FastLED.h>

#define LED_PIN     5
#define NUM_LEDS    12
#define BRIGHTNESS  255
#define LED_TYPE    NEOPIXEL
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];
/////////////////////////////
/////////// Speed ///////////
#define UPDATES_PER_SECOND 36
/////////////////////////////
CRGBPalette16 currentPalette;
TBlendType    currentBlending;

extern CRGBPalette16 Preset;
extern const TProgmemPalette16 Preset_p PROGMEM;


void setup() {
  delay( 3000 ); // power-up safety delay
  FastLED.addLeds<NEOPIXEL, LED_PIN>(leds, NUM_LEDS);
  FastLED.setBrightness(  BRIGHTNESS );

  currentPalette = Preset_p;
  currentBlending = LINEARBLEND;
}


void loop()
{


  static uint8_t startIndex = 0;
  startIndex = startIndex + 1;

  FillLEDsFromPaletteColors( startIndex);

  FastLED.show();
  FastLED.delay(1000 / UPDATES_PER_SECOND);
}

void FillLEDsFromPaletteColors( uint8_t colorIndex)
{
  //////////////////////////////
  uint8_t brightness = 255;
  //////////////////////////////
  for ( int i = 0; i < NUM_LEDS; i++) {
    leds[i] = ColorFromPalette( currentPalette, colorIndex, brightness, currentBlending);
    ////////////////////////////////////////////////////////////
    ///////////////// Changes the width of each color //////////
    colorIndex += 9;
    ////////////////////////////////////////////////////////////
  }
}


const TProgmemPalette16 Preset_p PROGMEM =
{ ////////////////////
  CRGB::Red,
  CRGB::Red,
  CRGB::Purple,
  CRGB::Purple,

  CRGB::Cyan,
  CRGB::Cyan,
  CRGB::Purple,
  CRGB::Purple,

  CRGB::Red,
  CRGB::Red,
  CRGB::Purple,
  CRGB::Purple,
  CRGB::Cyan,
  CRGB::Cyan,
  CRGB::Purple,
  CRGB::Purple,
  /////////////////////
};









#include "FastLED.h"


#define NUM_LEDS 12


#define DATA_PIN 5
#define CLOCK_PIN 13

// Define the array of leds
CRGB leds[NUM_LEDS];


void setup() { 

      FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
     
}

void loop() 
{

  for(int dot = 0; dot < NUM_LEDS; dot++)
 
  { 
    
    leds[dot] = CRGB::Red;
    FastLED.show();
    
    // clear this led for the next time around the loop
    leds[dot] = CRGB::Red;
    
    delay(25);
  }

    for(int dot = 0; dot < NUM_LEDS; dot++)
 
  { 
    
    leds[dot] = CRGB::Red;
    FastLED.show();
    
    // clear this led for the next time around the loop
    leds[dot] = CRGB::Purple;
    
    delay(25);
  }


for(int dot = 0; dot < NUM_LEDS; dot++)

  { 
    
    leds[dot] = CRGB::Cyan;
    FastLED.show();
    
    // clear this led for the next time around the loop
    leds[dot] = CRGB::Cyan;
    
    delay(25);
  }

  for(int dot = 0; dot < NUM_LEDS; dot++)
 
  { 
    
    leds[dot] = CRGB::Cyan;
    FastLED.show();
    
    // clear this led for the next time around the loop
    leds[dot] = CRGB::Purple;
    
    delay(25);
  }

  
}

but when I start renaming and moving the void setup/void loop around, it starts telling me that things are undefined

Read this:- http://www.thebox.myzen.co.uk/Tutorial/Merging_Code.html

Alright I was able to follow that article without any bumps. So now I have the two merged, but only the last one is displaying (but according to the article they are both running, I just can’t see them both). So the next thing to do I suppose would be to put them in some kind of order, with a timer, which I have no idea where to start to go about that.

Merged code:

#include <FastLED.h>

#define LED_PIN     5
#define NUM_LEDS    12
#define BRIGHTNESS  255
#define LED_TYPE    NEOPIXEL
#define COLOR_ORDER GRB

//start of 1st "Fade" effect
CRGB ledsFade[NUM_LEDS];
/////////////////////////////
/////////// Speed ///////////
#define UPDATES_PER_SECOND 36
/////////////////////////////
CRGBPalette16 currentPalette;
TBlendType    currentBlending;

extern CRGBPalette16 Preset;
extern const TProgmemPalette16 Preset_p PROGMEM;

void setup() {
  setupFade();
  setupPush();
}

void loop() {
  loopFade();
  loopPush();
}


void setupFade() {
  delay( 3000 ); // power-up safety delay
  FastLED.addLeds<NEOPIXEL, LED_PIN>(ledsFade, NUM_LEDS);
  FastLED.setBrightness(  BRIGHTNESS );

  currentPalette = Preset_p;
  currentBlending = LINEARBLEND;
}


void loopFade()
{


  static uint8_t startIndex = 0;
  startIndex = startIndex + 1;

  FillLEDsFromPaletteColors( startIndex);

  FastLED.show();
  FastLED.delay(1000 / UPDATES_PER_SECOND);
}

void FillLEDsFromPaletteColors( uint8_t colorIndex)
{
  //////////////////////////////
  uint8_t brightness = 255;
  //////////////////////////////
  for ( int i = 0; i < NUM_LEDS; i++) {
    ledsFade[i] = ColorFromPalette( currentPalette, colorIndex, brightness, currentBlending);
    ////////////////////////////////////////////////////////////
    ///////////////// Changes the width of each color //////////
    colorIndex += 9;
    ////////////////////////////////////////////////////////////
  }
}


const TProgmemPalette16 Preset_p PROGMEM =
{ ////////////////////
  CRGB::Red,
  CRGB::Red,
  CRGB::Purple,
  CRGB::Purple,

  CRGB::Cyan,
  CRGB::Cyan,
  CRGB::Purple,
  CRGB::Purple,

  CRGB::Red,
  CRGB::Red,
  CRGB::Purple,
  CRGB::Purple,
  CRGB::Cyan,
  CRGB::Cyan,
  CRGB::Purple,
  CRGB::Purple,
  /////////////////////
};



//Start of 2nd "Push" effect
#include "FastLED.h"
#define NUM_LEDS 12
#define DATA_PIN 5

// Define the array of leds
CRGB leds[NUM_LEDS];


void setupPush() {

  FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);

}

void loopPush()
{

  for (int dot = 0; dot < NUM_LEDS; dot++)

  {

    leds[dot] = CRGB::Red;
    FastLED.show();

    // clear this led for the next time around the loop
    leds[dot] = CRGB::Red;

    delay(25);
  }

  for (int dot = 0; dot < NUM_LEDS; dot++)

  {

    leds[dot] = CRGB::Red;
    FastLED.show();

    // clear this led for the next time around the loop
    leds[dot] = CRGB::Purple;

    delay(25);
  }


  for (int dot = 0; dot < NUM_LEDS; dot++)

  {

    leds[dot] = CRGB::Cyan;
    FastLED.show();

    // clear this led for the next time around the loop
    leds[dot] = CRGB::Cyan;

    delay(25);
  }

  for (int dot = 0; dot < NUM_LEDS; dot++)

  {

    leds[dot] = CRGB::Cyan;
    FastLED.show();

    // clear this led for the next time around the loop
    leds[dot] = CRGB::Purple;

    delay(25);
  }


}

So the next thing to do I suppose would be to put them in some kind of order, with a timer,

No you don’t.
Use print statements to see if both functions are being run. What happens if you comment out the call to the two loop functions one at a time?
It would help if you moved all the #includes to the start of the code along with all the variable declarations currently outside functions.

Are you happy to have the two effects one after the other?

If you want them to work together in different parts of the strip then you need to rewrite both functions as a state machine.
http://www.thebox.myzen.co.uk/Tutorial/State_Machine.html

Grumpy_Mike: Use print statements to see if both functions are being run. What happens if you comment out the call to the two loop functions one at a time?

When I comment out setupFade and loopfade, then the loopPush works (and vice versa).

I want them to run one after the other. Ideally the "Fade would run for about 4 minutes, then the "Push" would run for about 1 minute.

No just the loop call not the setup call. You probably have two different conflicting variable assignments.

When I comment out the loopFade, the Push runs; but when I comment out the loopPush, the fade does NOT run (the lights just turn off).

Current Sketch:

#include <FastLED.h>

#define LED_PIN     5
#define NUM_LEDS    12
#define BRIGHTNESS  255
#define LED_TYPE    NEOPIXEL
#define COLOR_ORDER GRB

//start of 1st "Fade" effect
CRGB ledsFade[NUM_LEDS];
/////////////////////////////
/////////// Speed ///////////
#define UPDATES_PER_SECOND 36
/////////////////////////////
CRGBPalette16 currentPalette;
TBlendType    currentBlending;

extern CRGBPalette16 Preset;
extern const TProgmemPalette16 Preset_p PROGMEM;

void setup() {
  setupFade();
  setupPush();
}

void loop() {
  loopFade();
  loopPush();
}


void setupFade() {
  delay( 3000 ); // power-up safety delay
  FastLED.addLeds<NEOPIXEL, LED_PIN>(ledsFade, NUM_LEDS);
  FastLED.setBrightness(  BRIGHTNESS );

  currentPalette = Preset_p;
  currentBlending = LINEARBLEND;
}


void loopFade()
{


  static uint8_t startIndex = 0;
  startIndex = startIndex + 1;

  FillLEDsFromPaletteColors( startIndex);

  FastLED.show();
  FastLED.delay(1000 / UPDATES_PER_SECOND);
}

void FillLEDsFromPaletteColors( uint8_t colorIndex)
{
  //////////////////////////////
  uint8_t brightness = 255;
  //////////////////////////////
  for ( int i = 0; i < NUM_LEDS; i++) {
    ledsFade[i] = ColorFromPalette( currentPalette, colorIndex, brightness, currentBlending);
    ////////////////////////////////////////////////////////////
    ///////////////// Changes the width of each color //////////
    colorIndex += 9;
    ////////////////////////////////////////////////////////////
  }
}


const TProgmemPalette16 Preset_p PROGMEM =
{ ////////////////////
  CRGB::Red,
  CRGB::Red,
  CRGB::Purple,
  CRGB::Purple,

  CRGB::Cyan,
  CRGB::Cyan,
  CRGB::Purple,
  CRGB::Purple,

  CRGB::Red,
  CRGB::Red,
  CRGB::Purple,
  CRGB::Purple,
  CRGB::Cyan,
  CRGB::Cyan,
  CRGB::Purple,
  CRGB::Purple,
  /////////////////////
};



//Start of 2nd "Push" effect
#define NUM_LEDS 12
#define DATA_PIN 5

// Define the array of leds
CRGB leds[NUM_LEDS];


void setupPush() {

  FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);

}

void loopPush()
{

  for (int dot = 0; dot < NUM_LEDS; dot++)

  {

    leds[dot] = CRGB::Red;
    FastLED.show();

    // clear this led for the next time around the loop
    leds[dot] = CRGB::Red;

    delay(25);
  }

  for (int dot = 0; dot < NUM_LEDS; dot++)

  {

    leds[dot] = CRGB::Red;
    FastLED.show();

    // clear this led for the next time around the loop
    leds[dot] = CRGB::Purple;

    delay(25);
  }


  for (int dot = 0; dot < NUM_LEDS; dot++)

  {

    leds[dot] = CRGB::Cyan;
    FastLED.show();

    // clear this led for the next time around the loopFa
    leds[dot] = CRGB::Cyan;

    delay(25);
  }

  for (int dot = 0; dot < NUM_LEDS; dot++)

  {

    leds[dot] = CRGB::Cyan;
    FastLED.show();

    // clear this led for the next time around the loop
    leds[dot] = CRGB::Purple;

    delay(25);
  }


}

By going through the FastLED example “Colorpalatte”; I was able to modify that sketch enough to do something very similar to what I’ve been looking for.

#include <FastLED.h>

#define LED_PIN     5
#define NUM_LEDS    12
#define BRIGHTNESS  255
#define LED_TYPE    NEOPIXEL
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];
/////////////////////////////
/////////// Speed ///////////
#define UPDATES_PER_SECOND 36
/////////////////////////////

CRGBPalette16 currentPalette;
TBlendType    currentBlending;

extern CRGBPalette16 Preset;
extern const TProgmemPalette16 Preset_p PROGMEM;
extern const TProgmemPalette16 Preset2_p PROGMEM;
extern const TProgmemPalette16 Wide_p PROGMEM;

void setup() {
  delay( 3000 ); // power-up safety delay
  FastLED.addLeds<NEOPIXEL, LED_PIN>(leds, NUM_LEDS);
  FastLED.setBrightness(  BRIGHTNESS );

  currentPalette = Preset_p;
  currentBlending = LINEARBLEND;
}


void loop()
{
  ChangePalettePeriodically();

  static uint8_t startIndex = 0;
  startIndex = startIndex + 1; /* motion speed */

  FillLEDsFromPaletteColors( startIndex);

  FastLED.show();
  FastLED.delay(1000 / UPDATES_PER_SECOND);
}

void FillLEDsFromPaletteColors( uint8_t colorIndex)
{
  //////////////////////////////
  uint8_t brightness = 255;
  //////////////////////////////
  for ( int i = 0; i < NUM_LEDS; i++) {
    leds[i] = ColorFromPalette( currentPalette, colorIndex, brightness, currentBlending);
    ////////////////////////////////////////////////////////////
    ///////////////// Changes the width of each color //////////
    colorIndex += 3;
    ////////////////////////////////////////////////////////////
  }
}



void ChangePalettePeriodically()
{
  uint8_t secondHand = (millis() / 1000) % 60;
  static uint8_t lastSecond = 99;

  if ( lastSecond != secondHand) {
    lastSecond = secondHand;

    if ( secondHand == 0)  {
      currentPalette = Preset_p;
      currentBlending = LINEARBLEND;
    }
    if ( secondHand == 20)  {
      currentPalette = Wide_p;
      currentBlending = LINEARBLEND;
    }
    if ( secondHand == 40)  {
      currentPalette = Preset2_p;
      currentBlending = LINEARBLEND;
    }
    if ( secondHand == 55)  {
      currentPalette = Preset2_p;
      currentBlending = NOBLEND;
    }

  }
}




const TProgmemPalette16 Preset_p PROGMEM =
{ ////////////////////
  CRGB::Red,
  CRGB::Red,
  CRGB::Purple,
  CRGB::Purple,

  CRGB::Cyan,
  CRGB::Cyan,
  CRGB::Purple,
  CRGB::Purple,

  CRGB::Red,
  CRGB::Red,
  CRGB::Purple,
  CRGB::Purple,

  CRGB::Cyan,
  CRGB::Cyan,
  CRGB::Purple,
  CRGB::Purple,
  /////////////////////
};


const TProgmemPalette16 Preset2_p PROGMEM =
{ ////////////////////
  CRGB::Red,
  CRGB::Purple,
  CRGB::Cyan,
  CRGB::Purple,

  CRGB::Red,
  CRGB::Purple,
  CRGB::Cyan,
  CRGB::Purple,

  CRGB::Red,
  CRGB::Purple,
  CRGB::Cyan,
  CRGB::Purple,
  CRGB::Red,
  CRGB::Purple,
  CRGB::Cyan,
  CRGB::Purple,
  /////////////////////
};


const TProgmemPalette16 Wide_p PROGMEM =
{ ////////////////////
  CRGB::Red,
  CRGB::Red,
  CRGB::Red,
  CRGB::Red,

  CRGB::Purple,
  CRGB::Purple,
  CRGB::Purple,
  CRGB::Purple,

  CRGB::Cyan,
  CRGB::Cyan,
  CRGB::Cyan,
  CRGB::Cyan,

  CRGB::Purple,
  CRGB::Purple,
  CRGB::Purple,
  CRGB::Purple,

  /////////////////////
};

OK, multiple problems but here is a sketch that runs each pattern for 10 seconds each:-

#include <FastLED.h>

#define LED_PIN     5
#define NUM_LEDS    12
#define BRIGHTNESS  65
#define LED_TYPE    NEOPIXEL
#define COLOR_ORDER GRB
// #define NUM_LEDS 12 these should have been removed because they are duplicates
//#define DATA_PIN 5

// Define the array of leds
CRGB leds[NUM_LEDS];
unsigned long startTime, timeToDoEffect;

//start of 1st "Fade" effect
// CRGB ledsFade[NUM_LEDS];
/////////// Speed ///////////
#define UPDATES_PER_SECOND 36
/////////////////////////////
CRGBPalette16 currentPalette;
TBlendType    currentBlending;

extern CRGBPalette16 Preset;
extern const TProgmemPalette16 Preset_p PROGMEM;

void setup() {
  setupFade();
  // setupPush(); // no need for this
  Serial.begin(9600);
}

void loop() {
  Serial.println("going into Fade");
  timeToDoEffect = 10 * 1000; // 10 seconds
  startTime = millis();
  while(millis() - startTime < timeToDoEffect) {
      loopFade();
  }
  Serial.println("going into Push");
  timeToDoEffect = 10 * 1000; // 10 seconds
  startTime = millis();
  while(millis() - startTime < timeToDoEffect) {
      loopPush();
  } 
}

void setupFade() {
  delay( 3000 ); // power-up safety delay - this is crap
  FastLED.addLeds<NEOPIXEL, LED_PIN>(leds, NUM_LEDS);
  FastLED.setBrightness(  BRIGHTNESS );
  currentPalette = Preset_p;
  currentBlending = LINEARBLEND;
}

/* as this contains just a call in the setupFade function their is no need to have it 
void setupPush() {
  FastLED.addLeds<NEOPIXEL, LED_PIN>(leds, NUM_LEDS);
  FastLED.setBrightness(  BRIGHTNESS );
}
*/

void loopFade()
{
  static uint8_t startIndex = 0;
  startIndex = startIndex + 1;
  FillLEDsFromPaletteColors( startIndex);
  FastLED.show();
  FastLED.delay(1000 / UPDATES_PER_SECOND);
}

void loopPush()
{
  for (int dot = 0; dot < NUM_LEDS; dot++)
  { 
    leds[dot] = CRGB::Red;
    FastLED.show();
    // clear this led for the next time around the loop
    //leds[dot] = CRGB::Red; but you wern't changing it
    delay(100);
    leds[dot] = CRGB::Black;
  }

  for (int dot = 0; dot < NUM_LEDS; dot++)
  {
    leds[dot] = CRGB::Red;
    FastLED.show();
    // clear this led for the next time around the loop
    leds[dot] = CRGB::Black;
    delay(100);
  }
  for (int dot = 0; dot < NUM_LEDS; dot++)
  {
    leds[dot] = CRGB::Cyan;
    FastLED.show();
    // clear this led for the next time around the loop
    // leds[dot] = CRGB::Cyan; but it was not clearing it
    leds[dot] = CRGB::Black;
    delay(100);
  }
  for (int dot = 0; dot < NUM_LEDS; dot++)
  {
    leds[dot] = CRGB::Cyan;
    FastLED.show();
    // clear this led for the next time around the loop
    // leds[dot] = CRGB::Purple;
    leds[dot] = CRGB::Black;
    delay(100);
  }
}

void FillLEDsFromPaletteColors( uint8_t colorIndex)
{
  uint8_t brightness = 255;
  for ( int i = 0; i < NUM_LEDS; i++) {
    // was ledsFade
    leds[i] = ColorFromPalette( currentPalette, colorIndex, brightness, currentBlending);
    ////////////////////////////////////////////////////////////
    ///////////////// Changes the width of each color //////////
    colorIndex += 9;
    ////////////////////////////////////////////////////////////
  }
}
// Not sure what this is doing - it is never called?
const TProgmemPalette16 Preset_p PROGMEM =
{ 
  CRGB::Red,
  CRGB::Red,
  CRGB::Purple,
  CRGB::Purple,

  CRGB::Cyan,
  CRGB::Cyan,
  CRGB::Purple,
  CRGB::Purple,

  CRGB::Red,
  CRGB::Red,
  CRGB::Purple,
  CRGB::Purple,
  CRGB::Cyan,
  CRGB::Cyan,
  CRGB::Purple,
  CRGB::Purple,
};

You had three main problems:-

  1. Each effect needed repeated calls into it in order for you to see anything happening. Therefore I have added a while loop that keeps calling each effect for a set period of time.

  2. Much more seriously was a lack of understanding of how FastLED works. You had defined two array buffers, one called ledFade and the other called led but you used the same pin number for each array. Therefore what the libiary did was to concatenate (join together) the two buffers. This meant that your buffer had twice the number of LEDs than you actually had and you could only see the first 12 of them the buffer. So when you commented out one effect’s setup you reduced the buffer to match the number of LEDs you had. The solution was to not create two arrays but only one and address it in both effects using the same name.

  3. Your push effect was faulty, your comment said you cleared the background but you just put the same colour back, I have changed this to black so you can see the advancing dot. Also your delay was far too short to see very much.

I have left in the debug print I used, you can remove this if you like. I have also commented out the things you need to remove once you have read them and understood what you needed to do. I also changed the BRIGHTNESS constant to save my eyes.

Edit:- Given that I have spent the last hour on this I think posting four minutes apart is not bad. :slight_smile:

I truly appreciate the help! As I'm sure you can tell I am about as new to this as I can possibly be. I will definitely be looking over what you posted and trying to learn all I can from it.