I need help with a specific issue.

I need help with a specific issue. I have minimized my code for troubleshooting purposes and the code is on pastebin. I’m trying to pass a pointer to a FastLED CRGB Array into a Object(SolidColor), so that said object can modify the Array.

In the code I have written, there is a method(Function) SolidColors::begins(). It tries to set the rgb values in the FastLED CRGB object. It compiles without errors, but leads to constant resets of the ESP8266.

I am using a Sparkfun Thingy Development Board
Arduino version 1.6.5
FastLED version 3.1.6

#include “FastLED.h”

#define NUM_LEDS 245
#define DATA_PIN 14
#define CLOCK_PIN 13

byte i = 1;
unsigned char brightness = 50;
CRGB bottomLeds[NUM_LEDS]; // Here is our FastLED Object

/////////////////////////////// class SolidColors //////////////////////////////////////////////////////////
/* The class constructor takes 4 inputs. Three inputs for RGB values, and one input of a pointer to a fastLED CGRB Object Array we wish to modifiy */
class SolidColors
{
public:
SolidColors(unsigned char strip, int rLevel, int gLevel, int bLevel, CRGB *LED_Array);
int stripNumber;
int redLevel;
int greenLevel;
int blueLevel;
void begins();
CRGB *LED_Array;
};

////////////// Constructor //////////////////
SolidColors::SolidColors(unsigned char strip, int rLevel, int gLevel, int bLevel, CRGB*LED_Array){
stripNumber = strip;
redLevel = rLevel;
greenLevel = gLevel;
blueLevel = bLevel;
}
/////////// End of Constructor ////////////////

void SolidColors::begins(){
Serial.print(" Begins fired off. ");
for(int iLed = 0; iLed < NUM_LEDS; iLed++){
//LED_Array[iLed].r = redLevel;
//LED_Array[iLed].g = greenLevel;
//LED_Array[iLed].b = blueLevel;
}
}
///////////////////////// End of class SolidColors ////////////////////////////////////////////////////////////////////////////////

SolidColors PersistantColor(1,0,0,200,bottomLeds); // Here is where we institaniate an Object of class SolidColors and pass in a pointer to the FastLED CRGB Object “botomLeds”.

void setup() {
Serial.begin(115200);
FastLED.addLeds<SK9822, DATA_PIN, CLOCK_PIN, BGR, DATA_RATE_MHZ(10)>(bottomLeds, NUM_LEDS);
LEDS.setBrightness(brightness);
}

void loop() {
while(i==1){
i = 0;
PersistantColor.begins();
Serial.print(“This message should show only once.”);
FastLED.show();
}
}

You never assign LED_Array in your constructor - so the value is some random value, which means when you write into it you are overwriting random memory.

EDIT: Now I saw that it is only one time any way it is good to yeld and as it said Daniel Garcia there is nowhere LED_Array assigned

ESP8266 don’t like that while true loops at least you have to yeld(); from time to time to feed the dog . Or make it every_n_millis with check for true for example. I hope you’ll understand what I mean . Just try your code with a different loop

Thank you guys. With your guidance I assigned that LED_Array in the constructor, and now life is good again!