Memory Error Message

Hi, I have compiled a sketch using 20 Neo pixel LEDs. There is a Theatre Chase component which has two colours running from 0-19 and 19-0 passing each other in the middle. I made another pattern to add on giving the effect of the two colours meeting in the middle and bouncing back to start. However when I try to run the sketch I get the following error message;
Any ideas?
Thanks,
Davy.

Not enough memory; see https://support.arduino.cc/hc/en-us/articles/360013825179 for tips on reducing your footprint.

Sketch uses 12076 bytes (37%) of program storage space. Maximum is 32256 bytes.

Global variables use 6381 bytes (311%) of dynamic memory, leaving -4333 bytes for local variables. Maximum is 2048 bytes.

data section exceeds available space in board

Compilation error: data section exceeds available space in board

Seems pretty straightforward. Your sketch, which you haven't shown, requires about 6.3.K of RAM. Your board, which you haven't specified, only has 2K of RAM. You either need to reduce your RAM footprint considerably, or use a board with considerably more RAM.

Thanks for reply Mate. Is there some way I can show you the sketch?
Cheers,
Davy.

The easiest way is probably to use edit / copy for forum in the IDE and next paste it here in a new reply.

To understand the more general way to use code tags, see the link provided by @Delta_G in post #4. Understanding the general way makes it easier for you to also post error messages and e.g. serial monitor output in code tags.

Hi sterretje.
I have attached the sketch which operates as compiled. I will send the modified version with the additional pattern which has too much information for memory.
PS. On the operating sketch, the Pattern part is set to run three times. There is a 500 or so millisecond pause between each set. Any idea why this is? I have tried changing delays, but no good.
Cheers,
Davy.

#include <Adafruit_NeoPixel.h>

#include <FastLED.h>  // Fastled library access required for some commands.

#define LED_PIN 4
#define NUM_LEDS 21
#define NUM_COLOURS 6
#define NUM_REPEATS
#define NUM_REPEATS patdog
uint8_t hue = 0;

// Define colours used
//CRGB colourOn = CRGB(255, 0, 0), colourBack;
//CRGB colourOff = CRGB(0, 0, 0);
CRGB colourList[6] = {CRGB(0, 0, 0), CRGB(0, 255, 0), CRGB(0, 0, 255),CRGB(255, 0, 0),};
CRGB colourListdog[6] = {CRGB(0, 0, 0), CRGB(255, 255, 0), CRGB(0, 255, 0),};
CRGB colourListcat[6] = {CRGB(0, 0, 0), CRGB(0, 255, 0), CRGB(255, 0, 0),CRGB(0, 0, 255), };
CRGB leds[NUM_LEDS];
// Define times for colour on and colour off in millis
int lengthOn = 10, lengthOff = 10;
int patterns[30][25] = {{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0},
{0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0},
{0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0},
{0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0},
{0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0},
{0,0,0,0,0,0,1,0,0,0,0,0,0,0,2,0,0,0,0,0,0},
{0,0,0,0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,0},
{0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,2,0,0,0,0,0},
{0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0},
{0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0},
{0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0},
{0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0},
{0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},






 


};

int patdog[30][25] = {{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0},
{0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0},
{0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0},
{0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0},
{0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0},
{0,0,0,0,0,0,1,0,0,0,0,0,0,0,2,0,0,0,0,0,0},
{0,0,0,0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,0},
{0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,2,0,0,0,0,0},
{0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0},
{0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0},
{0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0},
{0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0},
{0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},





  
};




void setup() {
  Serial.begin(9600);
  // Setup FastLED object
  FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
  FastLED.setBrightness(150);
  for (int j = 0; j < NUM_LEDS; ++j) {
    leds[j] = colourList[0];
  }
}

void loop() {
  Serial.println(" " );
  for (int j = 0; j < 30; j++)
  {
    Serial.println(j);
    // set color for every LED
    for (int i = 0; i < 25; i++) {
      leds[i] = colourList[ patterns[j][i] ];
    }
    FastLED.show();
    delay(200);
  }
  Serial.println(" " );
  for (int j = 0; j < 30; j++)
  {
    Serial.println(j);
    // set color for every LED
    for (int i = 0; i < 25; i++) {
      leds[i] = colourListcat[ patterns[j][i] ];
    }
    FastLED.show();
    delay(200);
  }
  Serial.println(" " );
  for (int j = 0; j < 30; j++)
  {
    Serial.println(j);
    // set color for every LED
    for (int i = 0; i < 25; i++) {
      leds[i] = colourList[ patterns[j][i] ];
    }
    FastLED.show();
    delay(200);
  }



  for (int j = 0; j < 3; j++)
  {
    Serial.println(j);
    leds[0] = CRGB(255, 0, 0); //Green LED
    leds[1] = CRGB(255, 0, 0); //Green LED
    leds[2] = CRGB(255, 0, 0); //Green LED
    leds[10] = CRGB(255, 0, 0); //Green LED
    leds[11] = CRGB(255, 0, 0); //Green LED
    leds[12] = CRGB(255, 0, 0); //Green LED
    leds[13] = CRGB(255, 255, 0); //Green LED
    leds[14] = CRGB(255, 0, 255); //Green LED
    leds[15] = CRGB(0, 255, 0); //Green LED
    leds[16] = CRGB(255, 0, 0); //Green LED
    leds[17] = CRGB(255, 0, 0); //Green LED
    leds[18] = CRGB(255, 255, 0); //Green LED
    leds[19] = CRGB(255, 0, 255); //Green LE
    leds[20] = CRGB(255, 0, 255); //Green LE
    FastLED.show();
    delay(100);
    leds[0] = CRGB(0, 0, 0); //Green LED
    leds[1] = CRGB(0, 0, 0); //Green LED
    leds[2] = CRGB(0, 0, 0); //Green LED
    leds[10] = CRGB(0, 0, 0); //Green LED
    leds[11] = CRGB(0, 0, 0); //Green LED
    leds[12] = CRGB(0, 0, 0); //Green LED
    leds[13] = CRGB(0, 0, 0); //Green LED
    leds[14] = CRGB(0, 0, 0); //Green LED
    leds[15] = CRGB(0, 0, 0); //Green LED
    leds[16] = CRGB(0, 0, 0); //Green LED
    leds[17] = CRGB(0, 0, 0); //Green LED
    leds[18] = CRGB(0, 0, 0); //Green LED
    leds[19] = CRGB(0, 0, 0); //Green LED 
    leds[20] = CRGB(0, 0, 0); //Green LED 
    FastLED.show();
    delay(100);
    
  }

  for (int j = 0; j < 3; j++)
  {
    Serial.println(j);
    leds[2] = CRGB(255, 0, 0); //Green LED
    leds[3] = CRGB(0, 255, 0); //Red LED
    leds[4] = CRGB(0, 0, 255); //Red LE
    FastLED.show();
    delay(500);
    leds[2] = CRGB(0, 0, 0); //Green LED
    leds[3] = CRGB(0, 0, 0); //Red LED
     leds[4] = CRGB(0, 0, 0); //Red LE
    FastLED.show();
    delay(100);
  }

  for (int j = 0; j < 3; j++)
  {
    Serial.println(j);
    leds[4] = CRGB(0, 0, 255); //Cyan LED
    leds[5] = CRGB(255, 0, 0); //Yellow LED
    leds[6] = CRGB(0, 255, 0); //Yellow LED
    FastLED.show();
    delay(500);
    leds[4] = CRGB(0, 0, 0); // cyan
    leds[5] = CRGB(0, 0, 0); //yellowLED
    leds[6] = CRGB(0, 0, 0); //Yellow LED
    FastLED.show();
    delay(100);
  }
  for (int j = 0; j < 4; j++)
  {
    Serial.println(j);
    leds[6] = CRGB(255, 0, 0); //Green LED
    leds[7] = CRGB(0, 255, 0); //Red LED
    FastLED.show();
    delay(100);
    leds[6] = CRGB(0, 0, 0); //Green LED
    leds[7] = CRGB(0, 0, 0); //Red LED
    FastLED.show();
    delay(100);
  }
  for (int j = 0; j < 9; j++)
  {
    Serial.println(j);
    leds[8] = CRGB(255, 0, 0); //Green LED
    leds[9] = CRGB(0, 255, 0); //Red LED
    FastLED.show();
    delay(100);
    leds[8] = CRGB(0, 0, 0); //Green LED
    leds[9] = CRGB(0, 0, 0); //Red LED
    FastLED.show();
    delay(100);
  }


  {
    for (int j = 0; j < 4; j++)
    {
      Serial.println(j);
      leds[8] = CRGB(0, 255, 0); //Green LED
      FastLED.show();
      delay(100);
      leds[8] = CRGB(0, 0, 0); //Green LED
      FastLED.show();
      delay(100);
      leds[9] = CRGB(255, 0, 0); //Red LED
      FastLED.show();
      delay(100);
      leds[9] = CRGB(0, 0, 0); //Red LED
      FastLED.show();
      delay(100);


    }
    for (int j = 0; j < 9; j++)
    {





    }
  }
}

Hi sterretje.
This is the modified sketch. The differences are the extended patterns, and the "int patterns are now [60] [50].
Cheers,
Davy.

#include <Adafruit_NeoPixel.h>

#include <FastLED.h>  // Fastled library access required for some commands.

#define LED_PIN 4
#define NUM_LEDS 21
#define NUM_COLOURS 6
#define NUM_REPEATS
#define NUM_REPEATS patdog
uint8_t hue = 0;

// Define colours used
//CRGB colourOn = CRGB(255, 0, 0), colourBack;
//CRGB colourOff = CRGB(0, 0, 0);
CRGB colourList[6] = {CRGB(0, 0, 0), CRGB(0, 255, 0), CRGB(0, 0, 255),CRGB(255, 0, 0),};
CRGB colourListdog[6] = {CRGB(0, 0, 0), CRGB(255, 255, 0), CRGB(0, 255, 0),};
CRGB colourListcat[6] = {CRGB(0, 0, 0), CRGB(0, 255, 0), CRGB(255, 0, 0),CRGB(0, 0, 255), };
CRGB leds[NUM_LEDS];
// Define times for colour on and colour off in millis
int lengthOn = 10, lengthOff = 10;
int patterns[60][50] = {{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0},
{0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0},
{0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0},
{0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0},
{0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0},
{0,0,0,0,0,0,1,0,0,0,0,0,0,0,2,0,0,0,0,0,0},
{0,0,0,0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,1,0,0,0,2,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,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0},
{0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0},
{0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0},
{0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},





  
};




void setup() {
  Serial.begin(9600);
  // Setup FastLED object
  FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
  FastLED.setBrightness(150);
  for (int j = 0; j < NUM_LEDS; ++j) {
    leds[j] = colourList[0];
  }
}

void loop() {
  Serial.println(" " );
  for (int j = 0; j < 30; j++)
  {
    Serial.println(j);
    // set color for every LED
    for (int i = 0; i < 25; i++) {
      leds[i] = colourList[ patterns[j][i] ];
    }
    FastLED.show();
    delay(100);
  }
  Serial.println(" " );
  for (int j = 0; j < 30; j++)
  {
    Serial.println(j);
    // set color for every LED
    for (int i = 0; i < 25; i++) {
      leds[i] = colourListcat[ patterns[j][i] ];
    }
    FastLED.show();
    delay(100);
  }
  Serial.println(" " );
  for (int j = 0; j < 30; j++)
  {
    Serial.println(j);
    // set color for every LED
    for (int i = 0; i < 25; i++) {
      leds[i] = colourList[ patterns[j][i] ];
    }
    FastLED.show();
    delay(100);
  }



  for (int j = 0; j < 3; j++)
  {
    Serial.println(j);
    leds[0] = CRGB(255, 0, 0); //Green LED
    leds[1] = CRGB(255, 0, 0); //Green LED
    leds[2] = CRGB(255, 0, 0); //Green LED
    leds[10] = CRGB(255, 0, 0); //Green LED
    leds[11] = CRGB(255, 0, 0); //Green LED
    leds[12] = CRGB(255, 0, 0); //Green LED
    leds[13] = CRGB(255, 255, 0); //Green LED
    leds[14] = CRGB(255, 0, 255); //Green LED
    leds[15] = CRGB(0, 255, 0); //Green LED
    leds[16] = CRGB(255, 0, 0); //Green LED
    leds[17] = CRGB(255, 0, 0); //Green LED
    leds[18] = CRGB(255, 255, 0); //Green LED
    leds[19] = CRGB(255, 0, 255); //Green LE
    leds[20] = CRGB(255, 0, 255); //Green LE
    FastLED.show();
    delay(300);
    leds[0] = CRGB(0, 0, 0); //Green LED
    leds[1] = CRGB(0, 0, 0); //Green LED
    leds[2] = CRGB(0, 0, 0); //Green LED
    leds[10] = CRGB(0, 0, 0); //Green LED
    leds[11] = CRGB(0, 0, 0); //Green LED
    leds[12] = CRGB(0, 0, 0); //Green LED
    leds[13] = CRGB(0, 0, 0); //Green LED
    leds[14] = CRGB(0, 0, 0); //Green LED
    leds[15] = CRGB(0, 0, 0); //Green LED
    leds[16] = CRGB(0, 0, 0); //Green LED
    leds[17] = CRGB(0, 0, 0); //Green LED
    leds[18] = CRGB(0, 0, 0); //Green LED
    leds[19] = CRGB(0, 0, 0); //Green LED 
    leds[20] = CRGB(0, 0, 0); //Green LED 
    FastLED.show();
    delay(300);
    
  }

  for (int j = 0; j < 3; j++)
  {
    Serial.println(j);
    leds[2] = CRGB(255, 0, 0); //Green LED
    leds[3] = CRGB(0, 255, 0); //Red LED
    leds[4] = CRGB(0, 0, 255); //Red LE
    FastLED.show();
    delay(500);
    leds[2] = CRGB(0, 0, 0); //Green LED
    leds[3] = CRGB(0, 0, 0); //Red LED
     leds[4] = CRGB(0, 0, 0); //Red LE
    FastLED.show();
    delay(100);
  }

  for (int j = 0; j < 3; j++)
  {
    Serial.println(j);
    leds[4] = CRGB(0, 0, 255); //Cyan LED
    leds[5] = CRGB(255, 0, 0); //Yellow LED
    leds[6] = CRGB(0, 255, 0); //Yellow LED
    FastLED.show();
    delay(500);
    leds[4] = CRGB(0, 0, 0); // cyan
    leds[5] = CRGB(0, 0, 0); //yellowLED
    leds[6] = CRGB(0, 0, 0); //Yellow LED
    FastLED.show();
    delay(100);
  }
  for (int j = 0; j < 4; j++)
  {
    Serial.println(j);
    leds[6] = CRGB(255, 0, 0); //Green LED
    leds[7] = CRGB(0, 255, 0); //Red LED
    FastLED.show();
    delay(100);
    leds[6] = CRGB(0, 0, 0); //Green LED
    leds[7] = CRGB(0, 0, 0); //Red LED
    FastLED.show();
    delay(100);
  }
  for (int j = 0; j < 9; j++)
  {
    Serial.println(j);
    leds[8] = CRGB(255, 0, 0); //Green LED
    leds[9] = CRGB(0, 255, 0); //Red LED
    FastLED.show();
    delay(100);
    leds[8] = CRGB(0, 0, 0); //Green LED
    leds[9] = CRGB(0, 0, 0); //Red LED
    FastLED.show();
    delay(100);
  }


  {
    for (int j = 0; j < 4; j++)
    {
      Serial.println(j);
      leds[8] = CRGB(0, 255, 0); //Green LED
      FastLED.show();
      delay(100);
      leds[8] = CRGB(0, 0, 0); //Green LED
      FastLED.show();
      delay(100);
      leds[9] = CRGB(255, 0, 0); //Red LED
      FastLED.show();
      delay(100);
      leds[9] = CRGB(0, 0, 0); //Red LED
      FastLED.show();
      delay(100);


    }
    for (int j = 0; j < 9; j++)
    {





    }
  }
}

Be careful, your for loops are writing to a strip of 25 LEDs, while you only have 21 defined.

There is no reason to use an int, which takes two bytes of memory, to store a value than can never exceed 5 (and with the color list arrays you have defined, should never go above 3).

Another tip, try bytes rather than ints for your arrays.

Hi Delta_G. My intention is to use the sketch to operate individual neopixels on a Monopoly board. Off the top of my head around 60. The patterns won't change. I am in my infancy with all this and am picking up dribs and drabs as I go along.
Davy.

HI David. Thanks for response Mate. How do I replace "int" and with what?
Davy.

Look at data types in Arduino Reference - Arduino Reference

You will have to follow the individual links and learn what they are.

To make it quick, check byte - Arduino Reference

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.