kitesurfer1404 / WS2812FX

WS2812 FX Library for Arduino and ESP8266
MIT License
1.58k stars 343 forks source link

Any chance that we can count animations on specific segments? #309

Closed StefanMeGit closed 1 year ago

StefanMeGit commented 2 years ago

I tried to set all the segments to white via:

ws2812fx.setSegment(0, firstLED, lastLED, FX_MODE_STATIC, PURPLE, 500, NO_OPTIONS);

then a activate another segment to an animation:

ws2812fx.setSegment(1, firstLED, lastLED, FX_MODE_RAINBOW, COLORS, 500, NO_OPTIONS);

But ws2812fx.isCycle() counts for every segment including segment 1, which is active all the time... is it possible to just get information when segement 1 is finished the animation?

moose4lord commented 2 years ago

The isCycle() function has two signatures:

bool WS2812FX::isCycle();
bool WS2812FX::isCycle(uint8_t seg);

You can use the second form and pass in the segment number to get the animation cycle status of a specific segment.