Hello all I've been working on code for my led matrix and I'd like to store the display message for rolling marquee mode in an array that can be updated via serial.. I'm not quite to that point yet but I was thinking about arrays and how they have to be declared with a size... Well the array itself will two dimensional and the first size will never change however it very very likely that the length will change with every update.. I know in c++. I would accomplish this by declaring the array with a pointer to the size that could later be changed. My question is as follows.is there a built in feature for dynamic arrays in Arduino as is becoming popular in most modern languages or shall I resort to pointers and if ivdo resort to pointers will they function like in c.
Arduino is C++ so use what you want. You could just create an array as big as the largest item to receive, and only use the parts needed.
Well I thought about that.. The problem is that I roll what's on the matrix back off into the message and if I made the messagearray too large then there would be an awkward time while all that space would be displayed
You could make it a circular buffer ( what I assume you already have ) and make the size variable by using a few integers to hold working data.
If you already have a copy of the data, when the lcd rolls off some, just dump the non visible stuff, and just keep track of the current position.
Define a accounting variable that will have the size of the data at buffer, when getting data only get the required bytes.