Followup question in a separate thread :) With 32x32 (1024 pixels),

Followup question in a separate thread :slight_smile:

With 32x32 (1024 pixels), the frame rate falls to about 15 fps, which is not surprising of course. This is where doing parallel driving with fastled on my teensy v3 would work better.
This also means not using Neomatrix (which quite frankly is super nice/handy). When switching to FastLED, do you folks write your own function to turn an X/Y coordinate into a pixel offset? (this is what Neomatrix does automatically, even with weird layouts)

Unrelated trivia: those 8x32 or 16x16 $35 panels can take about 10A each, or 40A total for 1024 pixels. I have a 5V 40A power supply, but needless to say that it makes for interesting wiring to send that much power into what’s otherwise a smallish looking array (of course that’s only needed for all pixels white on full brightness, and I usually take the brightness down to 15% or so)

So, how are people doing matrices without NeoMatrix when using FastLED instead of Adafruit’s library? I already saw others doing this, so I’m clearly not the only one :slight_smile:

@Marc_MERLIN I do my matrices without NeoMatrix only using FastLED And good programming.

@Yves_BAZIN thanks. So, you basically maintain your own function that converts array elements to pixel index? Do you need 2 arrays, one for the matrix, and one into which you copy the pixel values in the right order for the actual strip?

You don’t need to have two arrays. Depending on what you are doing and your wiring. I use two of them to be able to rotate the matrix easie so I can use the matrix horizontally or vertically by changing only one parameter. As I have a snake wiring (which is easier to build) it requires a little conversion formula to map a pixel to the matrix.

@Yves_BAZIN good to know. Sadly in my case, with tiled matrices that are pre-wired in a different order than the order the matrices are connected to one another, my order ends up being kind of crap, but thankfully neomatrix makes this a non event, I just declared how they were wired in the init, and it did the rest.
So basically it sounds like it would be great if neomatrix worked with FastLED. If I have spare time, I’ll see if I can make that work.

@Marc_MERLIN if you give me the wiring schema I should be able to write the conversion

@Yves_BAZIN thanks. If needed I can do this too, that’s what neomatrix does for me afterall. I just didn’t see why I would do the work the hard way if there is a generic way that already works :slight_smile:

@Marc_MERLIN good luck and let me know

@Marc_MERLIN What I’ve been doing - especially because I’ve been building some irregularly shaped projects and when wiring strips I’m much more concerned with the physical construction making sense than anything else - is just making a mask in Excel and using it as a lookup table

It takes a few minutes, but by creating the entire layout in excel with all of the pixels numbered in order, saving the file as a CSV, and then copying and pasting it into a const int[NUM_X*NUM_Y] array in your code, you can then just call a simple function of:

XYmap(int x, int y){
return MapLookupTable[x+((NUM_Y-y)*NUM_X)];
}

This translates anything in regular Cartesian coordinates (1,1 being the bottom left) to a 1d array starting at the top left the way it will come out after copying and pasting the table from Excel. Just be aware you might have some off by one errors depending on if your code expects coordinates to start at 0 or 1.

For an irregular shape, I populate any “missing” pixels with a number out of bounds of NUM_LEDS, so then I can easily ignore those pixels when I’m doing the mapping

by the way… isn’t 32*32 usually 1024? :stuck_out_tongue:

@chad_steinglass on days that I’ve slept enough, it is :slight_smile:

@Marc_MERLIN right there with you… math can be a fluid construct sometimes :slight_smile:

also wanted to mention - doing your own mapping will be frustrating for about an hour, but then once you figure it out you’ll be golden for all the rest of your projects no matter what shape they are.

The first thing I always do once I make my mapping function for a project (usually the lookup table I mentioned) is run a map test function - something like:

for(i = 0; i < NUMLEDS; i++){
leds[i]=CRGB::Red;
FastLED.Show();
dealy(50);
FastLED.Clear();
}

and

for(x = 1; x <= NUMLEDS; x++){
for(y = 1; y <= NUMY; y++){
leds[ XYmap(x,y)] =CRGB::Red;
}
FastLED.Show();
delay(50);
FastLED.Clear();
}

The first one just runs a red dot along the path of your leds in numerical order which you can use for troubleshooting. the second one should send a vertical line from left to right if your map is correct, and will instead send a garbled mess of red pixels if your map is off in some way. you can reverse the nesting of the loops if you want to send a horizontal line up as an extra test.

Thats basically the first thing I always do once I finish soldering a new matrix. Once that is good, then you know your mapping function is good and you can port over any animations you want

@chad_steinglass I get you on the mapping, sure it’s not that bad. That said, the main reason I like Neomatrix is the access to the adafruit GFX libraries, which are quite cool.
Sure, if you only ever display full size bitmaps, then it’s not that useful, but if you’d like to display text, pixmaps at certain coordinates, or like to draw lines, circles and so forth, the GFX library is quite cool.
If you haven’t seen it, see my demo here: https://youtu.be/9yGZLtewmfI?t=1m24s
(not super obvious but some of the patterns are drawn with GFX lines and circles, as well as fonts)
https://youtu.be/9yGZLtewmfI?t=52s

@Marc_MERLIN Looks really cool! Honestly I started with FastLED on day one with my very first arduino and my very first WS2811 LED (only about 16 months ago!), so I haven’t played with any other libraries. I’d love to delve a bit into them in order to see what types of animations are easier to design and code on each