Hi all, I’ve just finished building a 9 strip (each has 288 pixels) installation.
My question is around speed.
I’ve used a arduino mega and a multidimensional array (8,288) so each pixel can be individually addressed. But due to size I’m assuming the FASTLED.show() command pushes the entire array. So changes are slow even if I’m only actually making changes to a single strip or pixel.
I’ve done it this way because each strip is associated with a pressure pad, depending on which one is pushed a strip lights, so the array was ideal.
Is it possible to only send a set part of the array to a specific strip? In other words limit the show() command so it can send less data?
However, if you’re using an LED type that can use any pin on the Arduino (like WS2812), you could have each of 9 strips on a different pin, with a FastLED instance for each.
It isn’t yet documented well, but if you aren’t faint of heart, addLeds returns a pointer to the CLedController instance for that strip. You can then save that pointer and then call show on the individual controllers. Look in controller.h for the methods info.
It’s less of a stumble and more of a getting to making the example. The problem is there’s still some flux in the internals there so I haven’t put it out yet. But roughly, what you want is (apologies for sloppy code, no phone had a good keyboard for coding
That said - that will only work for choosing between your 9 strips[1], there isn’t a good way to send partial data to a strip (if you are manually calling show on a led controller instance you can give it a lower number for the count of pixels, however because of how these chips work, data will always start with the start of the strip.
[1] this is the kind of thing I am hoping to help with when I get the parallel output support published.
Damnit my reply got eaten. Examples are thin on the ground because not a lot of libraries tackle this. And in the case of FastLED - what you want to do is an edge case for most people - which is why i haven’t done up examples yet. Anyway, on to your code.
First up - you’re re-using the name leds for both your array of CRGB objects and your array of CLedController pointers - it should be:
and (this is a case where i’ve recently changed the API) you need a slight tweak to the addLeds lines (note the & in front of the FastLED.addLeds - this is because you want the address of the controller, and addLeds now returns references).:
TestLED.ino:18: error: stray '' in program
TestLED.ino:9: error: expected constructor, destructor, or type conversion before ‘*’ token
TestLED.ino: In function ‘void setup()’:
TestLED.ino:12: error: ‘ledStrips’ was not declared in this scope
TestLED.ino: In function ‘void loop()’:
TestLED.ino:17: error: ‘ledStrips’ was not declared in this scope
TestLED.ino: At global scope:
TestLED.ino:18: error: expected constructor, destructor, or type conversion at end of input
So i have no idea what’s going on in line 18 - or what’s causing the "error: stray ‘’ in program - it’s something that’s getting dropped out of what you’re pasting into the comment.
Ah - sorry - the line should be:
CLEDController *ledStrips[NUM_STRIPS];
(this is why i said look in controller.h - I shouldn’t trust my memory for this - and i’m in the middle of sanding a 6’ diameter acrylic disk right now
But still no idea what’s going on with the complaint on line 18.
What are you running this on? If it’s an arduino - you’re running out of memory. It only has 2048 bytes of ram, and your led array alone uses 7k of ram (8 * 288 * 3). Even the arduino mega only has 8k of ram - and you aren’t leaving a lot of room for, well, anything else. Also, the code you have above isn’t doing anything - there’s no setting led values or such. So, once it writes out the data that’s in the memory for the leds (which may be random, you haven’t set anything to anything, yet!), it’s just going to keep writing out that same thing over and over.