[OctoWS2811 lib] dynamic strip length

Status
Not open for further replies.
Hello,

I'd like to know if there is a way to dynamically set the length of the strips in the OctoWS2811 library?

Also, what are the impacts of not having the same count of leds on each outputs? And when only using, let's say, only the first 4 outputs?

Best regards and thanks for this great library!

Xavier
 
Hello Paul, thanks for your answer.

The idea here is to have a configurable pixel controller via Art-Net. In the Art-Net specification you have what we call "ArtCommand" messages to control your Art-Net node. So I'd like to send this kind of message to configure what are the pixel strips attached.

Here are the common use cases:
- change the strip, so maybe less or more leds
- strips of different size on each outputs (8 outputs at most)
- only use X out of the 8 outputs
- change the kind of strips, e.g. passing from RGB to RGBW (I want to stick with WS2812/13 and SK6812 for now)

My idea is to define the max values my board will handle, and it will be:
Code:
#define MAX_OUTPUTS 8 // max of outputs
#define MAX_CHANNELS_PER_LED 4  // max channels per leds
#define MAX_LEDS_PER_OUTPUTS 300  // max leds per output

So the max outputSize would be the following and I'll use if for the buffers:
Code:
const int outputSize = MAX_LEDS_PER_OUTPUTS * MAX_CHANNELS_PER_LED * 2; // 2400
DMAMEM int displayMemory[outputSize];
int drawingMemory[outputSize];
OctoWS2811 leds(MAX_NUM_LED_PER_OUTPUT, displayMemory, drawingMemory, ledConfig);

After that I could have variables defining how many outputs, how many leds per outputs and how many channel per leds are used. So the buffers won't be filled at their max but the data would be there. After that it would be just a matter of using the "leds.setPixel()" wisely?

I know I would have some unused sections of the buffers, but the teensy is fast enough so that wouldn't be a problem.

Something like this:
Code:
int currentOutput = 1;
int channelsPerLeds = 4;
int offset = 220; // number of leds on the previous strips
int ledCountOnThisOutput = 125;
byte *data = (byte *)dmx->Data;
for (int i = 0; i < ledCountOnThisOutput; i++) {
  if (channelsPerLeds == 3) {
    leds.setPixel(
      i + offset,
      data[i * 3],
      data[i * 3 + 1],
      data[i * 3 + 2]
    );
  }
  else if (channelsPerLeds == 4) {
    leds.setPixel(
      i + offset,
      data[i * 4],
      data[i * 4 + 1],
      data[i * 4 + 2],
      data[i * 4 + 3]
    );
  }
}

It's pseudo code untested, but it will bring you the idea.

So my questions are:
- is it possible at all? (I don't have the hardware in front of me for now)
- what would be the performance impact on a such approach?

FIY here is the prototype of my board
sIBvMi0.jpg


And a link to a project I realised with:
https://www.instagram.com/p/Bep1HxNhoiV/

Best regards
 
And here is the new version of the board

WVsYwMk.jpg

This is a 4 outputs version.

As you might notice I forgot to order some 10k ohms smd resistors so I put classic ones for now to test :eek:
 
Status
Not open for further replies.
Back
Top