2 segments with only 2 leds?
huge-11 opened this issue · comments
huge-11 commented
Hello,
i have a project that only requires 2 leds and and 2 segments, so one led per segment.
How can i do that?
my current attempt:
ws2812fx.setSegment(0, 0, 1, modeBLE, colors, StripSpeed, false);
ws2812fx.setSegment(1, 1, 1, modeBLE, colors, StripSpeed, false);
modeBLE and StripSpeed are variables int
and colors[] uint32_t
i get a strange behaviour on the second led? the first one is working fine.
i change the value of a variable and call ws2812fx.setSegment(1, 1, 1, modeBLE, colors, StripSpeed, false);
Keith Lord commented
The setSegment() function takes the first and last LED index as parameters. In your case, with one LED per segment, it would look like this:
uint32_t colors[] = {RED, GREEN, BLUE};
// parameters: segment index, start led index, stop led index, mode, color, speed, reverse
ws2812fx.setSegment(0, 0, 0, FX_MODE_STATIC, colors, 1000, false);
ws2812fx.setSegment(1, 1, 1, FX_MODE_BLINK, colors, 1000, false);
huge-11 commented
Ok, perfect thanks.