Wacky unknown pointer issues.

Thanks for the advice Paul. A lot of the stuff I have been writing, rewriting, and slamming debug code into it so it's messy and I do need to clean it up.

You are right about the setup() area. I'll write a method to fix that.

The destructor was left from another way I was approaching passing in arrays earlier. Again, just need to be cleaned up.

Although I did figure out what was wrong. Had nothing to do with pointers or arrays. It has to do with the millis() function. When it hit about 33000, it flipped to negative. Although I thought it could run for days without this problem, apparently it can't. When it flips, it skips the while loop from that point on since the test fails, even though it shouldn't. I still don't know why it breaks, but I did fix it.

void CubeControl::writeCube(cubeStep thisCube)
{
    int startTime = millis();
    byte arrayHolder[numRegisters];
    
    delay(1);
    
    int nowTime = millis();
    Serial.print("Time difference: ");
    Serial.println((nowTime - startTime));
    Serial.print("Current time: ");
    Serial.println(nowTime);
    Serial.print("Start Time: ");
    Serial.println(startTime);
    Serial.println();
    
    int testTime = nowTime - startTime;

    while(testTime <= thisCube.stepDuration)
    {
        Serial.println("In while loop. \n");
        
        for (int thisLayer = 0; thisLayer < numLayers; thisLayer++)
        {
            for (int regnum = 0; regnum < numRegisters; regnum++) 
            {
                arrayHolder[regnum] = thisCube.layer[thisLayer][regnum];
            }
            
            writeLayer(arrayHolder, thisLayer, thisCube.layerDuration);      
        }
        
        testTime = (millis() - startTime);
    }
        
    return;
}

Any clue why when calling millis() in the while loop test causes the test to fail?