64x64 LED Matrix - light up each individual pixel based on serial data

I have a 64x64 LED Matrix connected to my Arduino Mega 2560, and i want to be able to light up each LED with a chosen color through sending data via the serial to the Arduino.

Now since i want to be able to display pictures etc on the LED, i would have to send alot of data through the serial, and process it on the Arduino.

I have experimented a little bit by sending serial data in the format of the following:

<333,356,325,234,676>

where the the messages is defined to be between the ‘<’ and ‘>’, and each value between the commas is a color representation that i want a individual LED to light up. Each of these values is in the order as it should be printed out on the LED, i.e first value (333) is the pixel at x:0 y:0 , next at x:1 y:0 … etc.

Now since the LED matrix has 4096 pixels, the data sent through the serial would be very much, and i can’t store the whole message in, for example, a array.

Is the best way to split the serial data up in smaller pieces, where when each piece arrives i process it and light up the pixels? Or are there any better solution to this?

as each data value is recieved could you set up the corresponding pixel?
you could speed up transmission by transmtted data in binary

What type of led array? Post a link.

Even if the array is made of ws2812b leds, you will still need to store the data in an array. This is because the timing signals for ws2812 are very strict. The Arduino would not be able to receive the data from serial and send it out to the LEDs "on the fly" without storing it temporarily.

I think you should look to upgrade your Arduino for driving the display. Something with more memory and speed. Perhaps a Teensy 3.2, Maple Mini. Even a Wemos Mini (you don't have to use the WiFi, but you could make use of that later).

horace:
as each data value is recieved could you set up the corresponding pixel?
you could speed up transmission by transmtted data in binary

I'm not sure I'm following you here.. I can light up each individual LED on the matrix when each data value arrives yes, but this will also increase the time to render the whole matrix.

PaulRB:
What type of led array? Post a link.

Even if the array is made of ws2812b leds, you will still need to store the data in an array. This is because the timing signals for ws2812 are very strict. The Arduino would not be able to receive the data from serial and send it out to the LEDs "on the fly" without storing it temporarily.

I think you should look to upgrade your Arduino for driving the display. Something with more memory and speed. Perhaps a Teensy 3.2, Maple Mini. Even a Wemos Mini (you don't have to use the WiFi, but you could make use of that later).

I have the following: 64x64 RGB LED Matrix panel (3mm pitch) - dfrobot

Well, the main problem comes down to the fact that i can't store the color for each pixel in array, since this would become way too big for the Arduino (?). It would be a array with 4096 items. I don't think its the speed that is a problem.
That's why i was thinking of splitting up the data into smaller pieces, sending them individually, and then light up the corresponding pixels on the LED matrix. But i don't know if this is the best solution.

OK. You don’t need to store your serial data in an array. Or, rather, you don’t need to create an array to hold this data. In effect, the matrix library/object already has one. You can simply read the serial data and update the matrix, one pixel at a time, using the method:

matrix.drawPixel(x, y, c);

I can see there would be some advantages to breaking up the serial message. You could use the format:

<x,y,c0,c1,c2,c3.....>

where the first two numbers are the x y coordinates to start updating the matrix. c0…cN would then be the colours for a line of leds starting at the x y position and moving to the right. This would break the message for updating the whole display into 64 messages, each with 64 led colour values, like this:

<0,0,333,356,325,234,676,...>
<0,1,333,356,325,234,676,...>
...
<0,63,333,356,325,234,676,...>

This would also allow any part of the matrix to be updated, from a single pixel to the full display.