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

Add Aurora Borealis effect #1589

Merged
merged 10 commits into from
Jan 4, 2021
Merged

Add Aurora Borealis effect #1589

merged 10 commits into from
Jan 4, 2021

Conversation

Mazn1191
Copy link
Contributor

Added an aurora borealis effect based on my Arduino project: https://github.com/Mazn1191/Arduino-Borealis
I also added a second aurora palette since the original one doesn't quite felt right.

@Mazn1191 Mazn1191 changed the title Added Aurora Borealis effect Add Aurora Borealis effect Dec 28, 2020
@Mazn1191 Mazn1191 marked this pull request as draft December 29, 2020 07:40
@Mazn1191
Copy link
Contributor Author

I noticed I handle memory very poorly. Will need to do some rework.

@Aircoookie
Copy link
Member

Thank you for the PR :)
Yes, dynamically reallocating memory all the time isn't so good.
If you'd like, you can request a certain amount of memory for your effect using SEGENV.data (in this case that would be 20*the wave class size) and cast that pointer to your class.
Take a look at the mode_starbust or mode_dynamic effects to see how to use it :)

@Mazn1191
Copy link
Contributor Author

Thank you for the response :)
It took me a little longer to fully understand the concept and get an overview of all the functionality offered.
But I think now I've got it. I think I'll only allocate memory needed for the current amount of waves currently set by the slider. Always hogging memory for 20 waves seems a bit selfish :D 20 waves should need about 640byte of memory.

Use SEGENV to allocate and manage dynamic memory needs of effect.
Only allocate as much memory as needed for current amount of waves set.
@Mazn1191 Mazn1191 marked this pull request as ready for review December 31, 2020 10:22
@Mazn1191
Copy link
Contributor Author

Memory issues should be sorted out now ;)

Mazn1191 and others added 2 commits December 31, 2020 13:56
- Smoother on low speed
- CRGB is trivially copiable
- Replaced Red & Blue mode
- Simplified logic and mem use a tiny bit
- Aurora2 palette a bit less yellowish
@Aircoookie Aircoookie merged commit af61962 into wled:master Jan 4, 2021
@Mazn1191 Mazn1191 deleted the aurora branch January 4, 2021 11:48
Aircoookie added a commit that referenced this pull request Jan 5, 2021
Replaced Red & Blue effect with Aurora effect (PR #1589)
Updated copyright year and contributor page link
antbarney pushed a commit to antbarney/WLED that referenced this pull request Jan 7, 2021
* Added aurora effect

* Cosmetic changes prior to PR to match some guidelines

* Update FX.cpp

Moved mode_aurora function to end of FX.cpp

* Cosmetic changes prior to PR

- Changed new palette name to have a whitespace
- Undid changes to platformio.ini

* Removed commented out test palette

* Improved memory handling

Use SEGENV to allocate and manage dynamic memory needs of effect.
Only allocate as much memory as needed for current amount of waves set.

* Improvements to Aurora effect

- Smoother on low speed
- CRGB is trivially copiable
- Replaced Red & Blue mode
- Simplified logic and mem use a tiny bit
- Aurora2 palette a bit less yellowish

Co-authored-by: cschwinne <dev.aircoookie@gmail.com>
antbarney pushed a commit to antbarney/WLED that referenced this pull request Jan 7, 2021
Replaced Red & Blue effect with Aurora effect (PR wled#1589)
Updated copyright year and contributor page link
@obar
Copy link

obar commented Oct 22, 2024

I was so impressed with the Aurora effect that I had to look up this pull request to share a compliment. I love how this blends in so nicely when changing between color schemes. Well done @Mazn1191!

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

Successfully merging this pull request may close these issues.

3 participants