String memory conflicts with declarations

Hello,

I have a problem with 5 Neopixel.
I declare them before the Setup function.

I use strings to recieve data from the Serial-Port.

When I fill the data strings with information (or reserve them) some of the Neopixel stopp responding completly.

When I leave the strings empty they work fine. Somehow expecialy the last LED Strip seems to conflict with the memory occupied by the data.
There is enough memory available. Only 70% of flash and under 40% of SRAM is used.

If the memory is not reserved for the strings it will only read the first digit (or 0) of a given input.
If its reserved everything functions perfectly but the declared LED Strip won't respond at all

I don't understand, why these two instances have this conflict.....

I attached the whole code but basicly only the part before setup makes problems.

2Lichtleitsystem.ino (35.2 KB)

I can't see your code, but I'd guess the library for the Neopixels mallocs memory for each instance of the class, depending on the number of pixels in each instance.

This memory isn't reported at compile-time.

I have found the error. I had simply run out of SRAM because of two open strings....

How do I delete/close this post?

Here's how you can mark the thread solved:

  • At the bottom of the first post of the thread, click the "Quick Edit" link.
  • Click on the input field that contains the thread title.
  • To the start of the title, add the text: "[solved]"
  • Click the "Save" button.

It's helpful to do that because then people browsing the forum looking for threads they can help with will know they can skip over it and people who have the same problem and find this thread while searching for a solution can zero in on it as likely providing a helpful solution.

Thanks!