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

Allow to trigger callback after an effect is finished #83

Closed
wants to merge 5 commits into from

Conversation

jandelgado
Copy link
Owner

@jandelgado jandelgado commented Dec 11, 2021

#82 inspired this MR:
Added a new UpdateAndFinally method that will update the effect like Update but will trigger the provided callback when the effect is finished. This allows e.g. reconfiguration of an effect.

Example:

#include <jled.h>

auto breathe = JLed(2).Breathe(500);

void setup() { }

void loop()  {
  breathe.UpdateAndFinally(
          [] (JLed& led, void*) {
            led.Breathe(random(50,5000));
            led.Reset();
    }
  );
}

@coveralls
Copy link

coveralls commented Dec 11, 2021

Coverage Status

Coverage increased (+0.08%) to 97.03% when pulling 12684d8 on add_update_and_finally into 1971249 on master.

@jandelgado jandelgado force-pushed the add_update_and_finally branch 4 times, most recently from 24543c7 to 6a589c6 Compare December 11, 2021 21:53
@github-actions github-actions bot added the Stale label May 29, 2022
@github-actions github-actions bot closed this Jun 4, 2022
@jandelgado jandelgado reopened this Jun 4, 2022
@jandelgado jandelgado added keep and removed Stale labels Jun 4, 2022
@github-actions github-actions bot added the Stale label Sep 3, 2022
@github-actions github-actions bot closed this Sep 8, 2022
@jandelgado jandelgado reopened this Sep 8, 2022
@jandelgado jandelgado removed the Stale label Sep 8, 2022
@jandelgado jandelgado marked this pull request as draft November 13, 2022 12:14
@github-actions github-actions bot added the Stale label Feb 12, 2023
@github-actions github-actions bot closed this Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants