-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
add Rainbow Shimmer effect. Just like Rainbow Cycle but with a white … #4905
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -544,6 +544,41 @@ uint16_t mode_rainbow_cycle(void) { | |||||
| } | ||||||
| static const char _data_FX_MODE_RAINBOW_CYCLE[] PROGMEM = "Rainbow@!,Size;;!"; | ||||||
|
|
||||||
| /* | ||||||
| * Cycles a rainbow over the entire string of LEDs, with a white flash that goes across it. | ||||||
| */ | ||||||
| uint16_t mode_shimmer() { | ||||||
|
|
||||||
| uint32_t shimmerSpeed = 100 + (255 - SEGMENT.speed) * 40; // [100,10260ms] | ||||||
| uint32_t shimmerSize = (SEGMENT.custom1 * SEGLEN >> 9) + 1; // [1,SEGLEN/2+1] | ||||||
| uint32_t cycleTime = (255 - SEGMENT.intensity) * 150 + shimmerSpeed; // [100, 48510] | ||||||
|
|
||||||
| uint32_t percCycle = strip.now % cycleTime; | ||||||
| uint64_t shimmerIndex = ((uint64_t)percCycle<<8) / shimmerSpeed * (SEGLEN + 2*shimmerSize); | ||||||
|
|
||||||
| shimmerIndex -= shimmerSize << 8; | ||||||
|
|
||||||
| //change direction unless reverse is checked | ||||||
| if(!SEGMENT.check1) { | ||||||
| shimmerIndex = (((uint64_t) SEGLEN) << 8) - shimmerIndex; | ||||||
| } | ||||||
|
|
||||||
| for (unsigned i = 0; i < SEGLEN; i++) { | ||||||
| //shimmer logic | ||||||
| uint64_t distFromShimmerCenter = abs((int32_t)shimmerIndex - ((int64_t)i << 8)); | ||||||
|
|
||||||
| // Only process pixels that are within the shimmer's range. | ||||||
| if (distFromShimmerCenter < (shimmerSize<<8)) { | ||||||
| SEGMENT.setPixelColor(i, color_blend(SEGCOLOR(1), SEGCOLOR(0), 255-(distFromShimmerCenter / shimmerSize))); | ||||||
| } | ||||||
| else { | ||||||
| SEGMENT.setPixelColor(i,SEGCOLOR(1)); | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| return FRAMETIME; | ||||||
| } | ||||||
| static const char _data_FX_MODE_SHIMMER[] PROGMEM = "Shimmer@Speed,Frequancy,Size,,,Reverse;!!;sx=231,ix=221"; | ||||||
|
|
||||||
|
||||||
| static const char _data_FX_MODE_SHIMMER[] PROGMEM = "Shimmer@Speed,Frequancy,Size,,,Reverse;!!;sx=231,ix=221"; | |
| static const char _data_FX_MODE_SHIMMER[] PROGMEM = "Shimmer@Speed,Frequency,Size,,,Reverse;!!;sx=231,ix=221"; |
🤖 Prompt for AI Agents
In wled00/FX.cpp around lines 581-582, the user-facing metadata string contains
a typo: "Frequancy" should be "Frequency"; update the PROGMEM string to correct
the spelling while keeping the existing parameter order and mapping
(Speed,Frequancy,Size,,,Reverse) unchanged so Speed maps to speed slider,
Frequency to intensity slider, Size to custom1 and Reverse to check1.
Uh oh!
There was an error while loading. Please reload this page.