Skip to content

Add moving skip to Chase 2#5504

Open
RussStringham wants to merge 1 commit intowled:mainfrom
RussStringham:chase-skip
Open

Add moving skip to Chase 2#5504
RussStringham wants to merge 1 commit intowled:mainfrom
RussStringham:chase-skip

Conversation

@RussStringham
Copy link
Copy Markdown

@RussStringham RussStringham commented Apr 14, 2026

I have added a new slider to Chase 2 that generates values between 0 and 15. When this slider is at its default value of 0, it behaves exactly like the current version of Chase 2. When the slider is greater than 0, it is treated as a skip value. At any instance in time, the result looks the same as when a skip is specified in the segment definition. However, when the stripe moves by one LED, it moves to the next physical LED, rather than the next lit LED. This results is the skips rotatings as well.

Summary by CodeRabbit

  • New Features

    • Added Skip control parameter to the running color effect, enabling customization of striped rendering patterns with variable gaps between stripes.
  • Improvements

    • Enhanced the running color effect with improved animation progression and refined LED color assignment logic for better visual stripe pattern rendering.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 14, 2026

Walkthrough

The running() effect helper function was updated to accept a skip parameter and implement a "striped with gaps" rendering mode. Period calculation logic was modified using modular arithmetic for LED color assignment, and mode_running_color() was adjusted to pass the skip value with metadata extended to expose the Skip control.

Changes

Cohort / File(s) Summary
Running Effect Enhancement
wled00/FX.cpp
Updated running() helper to accept skip parameter for new striped-with-gaps rendering mode. Added period calculation logic based on width, pitch, and stripe length with modular arithmetic for per-LED color assignment. Modified step progression wrapping logic and adjusted mode_running_color() to pass skip value; extended metadata to expose Skip control.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Add moving skip to Chase 2' is too vague and misleading. It doesn't accurately describe the actual implementation, which modifies the running() helper function to accept a skip parameter and implements striped rendering logic. The title suggests a simple feature addition but doesn't convey that this involves significant internal refactoring of the rendering mode. Use a more descriptive title that reflects the actual changes, such as 'Implement skip parameter for striped gap rendering in running effect' or 'Add configurable skip stripes to Chase 2 effect'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
wled00/FX.cpp (1)

555-570: Rename stripe_len to stripeLen.

This is the only new snake_case local in the block; keeping it camelCase would match the surrounding C++ additions.

♻️ Suggested rename
-  int stripe_len = width * pitch - skip;
+  int stripeLen = width * pitch - skip;
@@
-      if (pos < stripe_len) {
+      if (pos < stripeLen) {
         col = (pos % pitch == 0) ? color1 : 0;                              // foreground stripe
-      } else if (pos < stripe_len + skip) {
+      } else if (pos < stripeLen + skip) {
         col = 0;                                                              // black gap after foreground
-      } else if (pos < 2 * stripe_len + skip) {
-        col = (((pos - stripe_len - skip) % pitch) == 0) ? color2 : 0;      // background stripe
+      } else if (pos < 2 * stripeLen + skip) {
+        col = (((pos - stripeLen - skip) % pitch) == 0) ? color2 : 0;      // background stripe
       } else {
As per coding guidelines, "Use camelCase for C++ function and variable names".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@wled00/FX.cpp` around lines 555 - 570, The local variable stripe_len should
be renamed to stripeLen to match camelCase C++ naming; update its declaration
and all uses in this block (the calculation using width * pitch - skip and all
subsequent comparisons like pos < stripe_len and 2 * stripe_len + skip) to
stripeLen, ensuring consistency with surrounding identifiers such as period,
theatre, SEGENV.aux0, color1/color2, pos, SEGLEN and the usePalette branch
(SEGMENT.color_from_palette) so the logic and references remain unchanged except
for the identifier rename.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@wled00/FX.cpp`:
- Around line 555-570: The local variable stripe_len should be renamed to
stripeLen to match camelCase C++ naming; update its declaration and all uses in
this block (the calculation using width * pitch - skip and all subsequent
comparisons like pos < stripe_len and 2 * stripe_len + skip) to stripeLen,
ensuring consistency with surrounding identifiers such as period, theatre,
SEGENV.aux0, color1/color2, pos, SEGLEN and the usePalette branch
(SEGMENT.color_from_palette) so the logic and references remain unchanged except
for the identifier rename.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 059d7063-3e50-4601-86d4-d8037ddf2059

📥 Commits

Reviewing files that changed from the base of the PR and between ba377d7 and 2a829f2.

📒 Files selected for processing (1)
  • wled00/FX.cpp

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.

1 participant