Hi everyone Im new to the group.

Hi everyone Im new to the group.

Im posting here because I have been trying for some time now to figure how to display code that looks like this:

const PROGMEM prog_uint8_t povData[] = {
60, 0, 0,
60, 0, 0,
60, 0, 0,
60, 0, 0,
60, 0, 0,
60, 0, 0,
60, 0, 0,
60, 0, 0,
7, 0, 0,
1, 2, 242,
1, 3, 150,
1, 0, 11,
50, 0, 0,
7, 0, 0,
1, 206, 186,
1, 255, 255,
1, 215, 191,
1, 158, 126,
1, 68, 153,
1, 1, 113,
1, 0, 5,
46, 0, 0,
7, 0, 0,
1, 214, 154,
4, 255, 255,
1, 239, 255,
1, 183, 95,
1, 117, 156,
1, 3, 53,
1, 0, 12,
43, 0, 0,
7, 0, 0,
1, 214, 154,
8, 255, 255,
1, 215, 191,
1, 158, 158,
1, 76, 153,
1, 2, 18,
1, 0, 8,
39, 0, 0,
7, 0, 0,
1, 214, 154,
11, 255, 255,
1, 239, 255,
1, 191, 95,
1, 125, 188,
1, 3, 150,
1, 0, 12,
36, 0, 0,
7, 0, 0,
1, 214, 154,
15, 255, 255,
1, 215, 223,
1, 158, 158,
1, 76, 217,
1, 2, 18,
1, 0, 8,
32, 0, 0,
7, 0, 0,
1, 214, 154,
18, 255, 255,
1, 239, 255,
1, 191, 95,
1, 125, 188,
1, 3, 150,
1, 0, 14,
29, 0, 0,
7, 0, 0,
1, 214, 154,
22, 255, 255,
1, 223, 223,
1, 158, 190,
1, 76, 218,
1, 2, 19,
1, 0, 8,
25, 0, 0,
7, 0, 0,
1, 214, 154,
25, 255, 255,
1, 239, 255,
1, 199, 127,
1, 133, 252,
1, 43, 214,
1, 0, 14,
22, 0, 0,
7, 0, 0,
1, 214, 154,
29, 255, 255,
1, 223, 223,
1, 166, 254,
… ect

I cant for the life of me find what this kind of code is called or how to get the Arduino to display it. Its normally placed within a .h library.
Are there ANY tutorials on this sorta thing anywhere?
Its a image meant for a pov display wand that Im trying to figure out how to make. Any leads to get me understanding this would be way helpful. I have ALL the adafruit tuts. They hardly help.
I have read through the whole FastLED Wiki and the Arduino website, spent hours looking on youtube. No luck.
The frustration is starting to make this no fun anymore.
The github for this stuff is https://github.com/Blinkinlabs/PatternPaint/tree/master/PatternPaint
please if anyone has links to tutorials that can help me understand this I’d be so grateful.

Thanks in advance.

I haven’t done anything with POV, but I think I understand what you’re trying to do. It looks like you need to grab three numbers at a time from the array, assign those to R,G,B and then plug those into a pixel. Once you have done that NUM_LEDS times, display it, and continue reading data.

For this example let’s assume a vertical POV strip, so the image height is equal to NUM_LEDS. You would either need to know the image width, or the size of the data array. If you don’t know w, it can be calculated as:
width = size of data array divided by height divided by 3

Let’s assume the width is 100 for this example.

Add to your variables:
uint8_t dataR, dataG, dataB // For storing RGB data.
int height = NUM_LEDS // Height of image.
int width = 100 // Width of image if known, or calculate it
// elsewhere if you only know the povData array size.

And in your main loop:
for (int w=1, w <= width, w++) { // Note: starting count at 1
for (int h=1, h <= height, h++){ // Note: starting count at 1
dataR = pgm_read_byte(&povData[(hw3)-3) * w]; //[EDIT - Oops incorrect. See post below…]
dataG = pgm_read_byte(&povData[(hw3)-2) * w];
dataB = pgm_read_byte(&povData[(hw3)-1) * w];
leds[h-1] = CRGB(dataR, dataG, dataB);
}
}
FastLED.show(); // Display the pixels after each column of data is collected.
}

Oops, that should be:
dataR = pgm_read_byte(&povData[(hw3)-3]);
dataG = pgm_read_byte(&povData[(hw3)-2]);
dataB = pgm_read_byte(&povData[(hw3)-1]);

EDIT corrected again! I hope. :stuck_out_tongue:

Not that using PROGMEM is wrong, however depending on how much data you’re going to be displaying, you may run into limitations rather quickly. For example, if you want to change the data, you’re reprogramming the controller each and every time. A different approach is to use an external storage, like an SD card.

All of my POV data sits in individual files on an SD card, together with a single control file. The controller reads that control file to know what files are available. If I want to change the data, all I have to do it add/replace the files on the SD card, update the control file and done. No reprogramming necessary.

I think that some of these Adafruit tutorials will help you:
https://learn.adafruit.com/search?q=painting
especially:

FYI, it was because of some of the other Adafruit tutorials that I found out about FastLED.