Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't repeat the animation after reaching the end of the segment? #2

Open
OSDDQD opened this issue Apr 19, 2021 · 8 comments
Open

Don't repeat the animation after reaching the end of the segment? #2

OSDDQD opened this issue Apr 19, 2021 · 8 comments

Comments

@OSDDQD
Copy link

OSDDQD commented Apr 19, 2021

Hello, your library is very user-friendly and allows you to do great things with less code.
I had one question:
I have divided the strip into 12 segments and I want to make the segment play the animation once, how can I achieve this?
My current code:
https://gist.github.com/OSDDQD/575b3270baeeceda3c9d058701cda1b7

@gmoehrke
Copy link
Owner

gmoehrke commented Apr 19, 2021 via email

@OSDDQD
Copy link
Author

OSDDQD commented Apr 20, 2021

Thank you for such a quick response. is it possible to determine which segment has now completed the cycle in this method? Each segment differs only in the number of pixels

@gmoehrke
Copy link
Owner

gmoehrke commented Apr 20, 2021 via email

@OSDDQD
Copy link
Author

OSDDQD commented Apr 21, 2021

Perhaps it is worth making it a separate issue
The findSegment function produces a compilation error:
error: no matching function for call to 'FFXController :: findSegment (const char [6])'

@gmoehrke
Copy link
Owner

gmoehrke commented Apr 21, 2021 via email

@OSDDQD
Copy link
Author

OSDDQD commented Apr 21, 2021

I'm using #3 example for base, like that in setup section:

  FFXSegment *seg;

  seg = fxctrlr.addSegment("First", 0, 32);
  seg->setFX( new FirstLightFX( seg->getLength() ));
  seg->getFX()->getFXColor().setCRGB( CRGB::Aqua);
  seg->getFX()->setMovement( FFXBase::MovementType::MVT_FORWARD);
  seg->setOpacity(255);

And this in loop section:
FFXSegment seg = fxctrlr.findSegment("First");

I'm not using constants for segment names

@gmoehrke
Copy link
Owner

Ok: I'll have to add a method for findSegment that handles that, in the meantime -
Try:
String segName = "First";
FFXSegment seg = fxctrlr.findSegment( segName );

@OSDDQD
Copy link
Author

OSDDQD commented Apr 24, 2021

Thank you, using overlay is correct solution in my case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants