integration of 2 codes

Hello all
i am trying to integrate 2 codes
The idea is to combine a singe color with animation namely, run color for x minutes delay(100060Minutes); and then switch to a short animation and than back to a color, and so on ( loop)
i am trying to combine among functions, since i am very new to programing i keep getting errors
gear: Arduino mega

  • ws2812*
    i am attaching the codes for your review

any chance someone could assist me with it?

Thanks in advance

study color code:

#define LED_TYPE WS2812B // type of RGB LEDs
#define COLOR_ORDER GRB // sequence of colors in data stream
#define NUM_LEDS 60 // 60 LEDs numbered [0..59]
#define DATA_PIN 5 // LED data pin
#define BRIGHTNESS 88 // brightness range [off..on] = [0..255]
CRGB leds[NUM_LEDS];

#define UPDATES_PER_SECOND 100

CRGBPalette16 currentPalette;
TBlendType currentBlending;

extern CRGBPalette16 myRedWhiteBluePalette;
extern const TProgmemPalette16 myRedWhiteBluePalette_p PROGMEM;
void setup() {
delay( 3000 ); // power-up safety delay
FastLED.addLeds<LED_TYPE,DATA_PIN , COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
FastLED.setBrightness( BRIGHTNESS );

currentPalette = RainbowColors_p;
currentBlending = LINEARBLEND
}
void setup() {
// initialize library using CRGB LED array
FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS)
}
void loop() {
// use a routine to fill a block of LEDs with a fixed color
fill_solid( &(leds[0]), 5 /number of leds/, CRGB(51, 220, 255));
fill_solid( &(leds[5]), 5 /number of leds/, CRGB(255, 0,0));
fill_solid( &(leds[10]), 5 /number of leds/, CRGB(255, 140,25));
fill_solid( &(leds[15]), 5 /number of leds/, CRGB(0, 255,255));
fill_solid( &(leds[20]), 5 /number of leds/, CRGB(0, 255,255));
fill_solid( &(leds[25]), 5 /number of leds/, CRGB(01, 255,255));
fill_solid( &(leds[30]), 5 /number of leds/, CRGB(0, 221,255));
fill_solid( &(leds[35]), 5 /number of leds/, CRGB(255, 51,255));
fill_solid( &(leds[40]), 5 /number of leds/, CRGB(0, 255,255));
fill_solid( &(leds[45]), 5 /number of leds/, CRGB(0, 255,255));
fill_solid( &(leds[50]), 5 /number of leds/, CRGB(255, 0,0));
fill_solid( &(leds[55]), 5 /number of leds/, CRGB(0, 255,255));
// activate all changes to LEDs
FastLED.show();

delay (5000);
}

animation patterns
#include <FastLED.h>
#define LED_TYPE WS2812B // type of RGB LEDs
#define COLOR_ORDER GRB
#define LED_PIN 5
#define NUM_LEDS 60
#define BRIGHTNESS 88
#define LED_TYPE WS2812
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];
#define UPDATES_PER_SECOND 100
CRGBPalette16 currentPalette;
TBlendType currentBlending;
extern CRGBPalette16 myRedWhiteBluePalette;
extern const TProgmemPalette16 myRedWhiteBluePalette_p PROGMEM;
void setup() {
delay( 3000 ); // power-up safety delay
FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
FastLED.setBrightness( BRIGHTNESS );
currentPalette = RainbowColors_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 = ColorFromPalette( currentPalette, colorIndex, brightness, currentBlending);

  • colorIndex += 3;*

  • }*
    }
    // There are several different palettes of colors demonstrated here.
    //
    // FastLED provides several 'preset' palettes: RainbowColors_p, RainbowStripeColors_p,
    // OceanColors_p, CloudColors_p, LavaColors_p, ForestColors_p, and PartyColors_p.
    //
    // Additionally, you can manually define your own color palettes, or you can write
    // code that creates color palettes on the fly. All are shown here.
    void ChangePalettePeriodically()
    {

  • uint8_t secondHand = (millis() / 1000) % 60;*

  • static uint8_t lastSecond = 99;*

  • if( lastSecond != secondHand) {*

  • lastSecond = secondHand;*

  • if( secondHand == 0) { currentPalette = RainbowColors_p; currentBlending = LINEARBLEND; }*

  • if( secondHand == 10) { currentPalette = RainbowStripeColors_p; currentBlending = NOBLEND; }*

  • if( secondHand == 15) { currentPalette = RainbowStripeColors_p; currentBlending = LINEARBLEND; }*

  • if( secondHand == 20) { SetupPurpleAndGreenPalette(); currentBlending = LINEARBLEND; }*

  • if( secondHand == 25) { SetupTotallyRandomPalette(); currentBlending = LINEARBLEND; }*

  • if( secondHand == 30) { SetupBlackAndWhiteStripedPalette(); currentBlending = NOBLEND; }*

  • if( secondHand == 35) { SetupBlackAndWhiteStripedPalette(); currentBlending = LINEARBLEND; }*

  • if( secondHand == 40) { currentPalette = CloudColors_p; currentBlending = LINEARBLEND; }*

  • if( secondHand == 45) { currentPalette = PartyColors_p; currentBlending = LINEARBLEND; }*

  • if( secondHand == 50) { currentPalette = myRedWhiteBluePalette_p; currentBlending = NOBLEND; }*

  • if( secondHand == 55) { currentPalette = myRedWhiteBluePalette_p; currentBlending = LINEARBLEND; }*

  • }*
    }
    // This function fills the palette with totally random colors.
    void SetupTotallyRandomPalette()
    {

  • for( int i = 0; i < 16; i++) {*
    _ currentPalette = CHSV( random8(), 255, random8());_
    * }*
    }
    Thanks in advance

Needs more code tag

Needs the full text of any and all error messages too. The error you posted appears to be incomplete.

here is the link for the full code of patterns i ain't gonna use al of them, just a few and just some solid colors as written in the main post and let each solid color to work for 10 minutes and then run animation and to a different solid color ~loop

Thanks

merging two or more programs is fraught with problems for anyone, let alone a beginner...
I wrote a thread in Introductory Tutorials that might help you approach the problem.

https://forum.arduino.cc/index.php?topic=624556.0

Arrow008:
here is the link for the full code of patterns i ain't gonna use al of them, just a few and just some solid colors as written in the main post and let each solid color to work for 10 minutes and then run animation and to a different solid color ~loop

ColorPalette.ino - Google Drive

Thanks

This does not address the questions asked by me or TMFKaAWOL. Where is the full text of any and all error messages from your modified sketch?

Also, nobody wants to follow a link and download a file. Remember we are helping you for free, and many of us post/read from a cellphone, on which a downloaded file won't open correctly. You were on the right track with your OP - but you need to use code tags, otherwise the forum will parse pieces of your code as markup.

For example,

[i]

starts a block of italics.