-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
feat: KITT usermod effect #3756
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
Conversation
|
That seems similar to K.I.T.T (Scanner and Scanner dual) existing effects. |
Yes, but there is no delay feature and this combines two effects into one |
I managed to test the effect but apart from the delay on one side of the scan it is no different than the mentioned Scanner. I was also wondering about modulus (%) used in the effect. It is quite inefficient. What if we incorporate the delay into original effect? |
|
In the original show it was quite common to see intermittent scans, but the scan always did a full loop not one way. Plus the effect gets quite tiring if it is continuous. Optimisation vs maintenance. A single division operation per segment once every 23ms? How many microseconds are saved, 0.01us? I'd have thought changing the behaviour of an existing effect would be the last thing to suggest for backward compatibility. |
|
Can we close this PR in favour of #3763 ? Or is this usermod still "sufficiently different" so to keep it open? |
I was going to add support for 2D matrices but since blaz doesn't seem to like collaboration maybe he can add it to his. I don't have time. |
I did not know this. Thanks for enlightening me. |
|
Can someone please write this effect as found when you save the presets as json file? |
|
Hey! This pull request has been open for quite some time without any new comments now. It will be closed automatically in a week if no further activity occurs. |
WalkthroughThis change introduces a new usermod feature called KITT, which replicates the lighting effect inspired by the 1980s TV show Knight Rider. The update adds accompanying documentation, a new usermod class with methods for setup, effect processing, and identification, a new constant identifier in the configuration header, and registration code to enable the KITT effect when configured. All changes are integrated via new files and updates to existing ones. Changes
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
usermods/usermod_v2_KITT/README.md (1)
1-8: Consider adding basic configuration instructions.
Currently, the README summarizes the concept and flags needed for compilation but doesn’t detail how to set up or tune the KITT effect parameters (speed, tail length, delay, dual mode). A short usage section clarifying these controls would help new users.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
usermods/usermod_v2_KITT/README.md(1 hunks)usermods/usermod_v2_KITT/usermod_v2_KITT.h(1 hunks)wled00/const.h(1 hunks)wled00/usermods_list.cpp(2 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
wled00/const.h (1)
usermods/usermod_v2_KITT/usermod_v2_KITT.h (1)
USERMOD_ID_KITT(62-64)
🔇 Additional comments (7)
wled00/const.h (1)
154-154: No issues with new usermod ID definition.
The newly introduced identifierUSERMOD_ID_KITTcorrectly follows the existing pattern of usermod IDs. The skip of number 44 may be intentional or reserved; no immediate problems are detected.wled00/usermods_list.cpp (2)
204-207: Include directive looks good.
The conditional inclusion ofusermod_v2_KITT.hunder#ifdef USERMOD_KITTfollows the standard pattern and should safely integrate the KITT usermod without affecting others.
389-391: Registration logic appears correct.
InstantiatingKITTUsermodunderUSERMOD_KITTis consistent with WLED’s approach for adding usermods, and no conflicts are apparent.usermods/usermod_v2_KITT/usermod_v2_KITT.h (4)
8-49: The scanning logic is well-structured.
- Correctly handles single and multiple LED segments without off-by-one risks.
- Uses delays (
SEGMENT.step) and position tracking (SEGMENT.aux0) to produce the forward/backward sweep.- The fade-out invocation and optional dual reflection mode look logically sound.
51-65: Setup and metadata methods are clean.
- Registering the KITT mode via
strip.addEffect()is consistent with WLED’s add-on model.loop()stub is acceptable if no continuous processing is needed.getId()aligns with the newly introduced constant inconst.h.
67-69: Configuration string is concise and clear.
The string-based parameter definition for speed, tail, delay, and dual mode should integrate smoothly with WLED’s UI. No changes required.
1-7:Details
✅ Verification successful
Verify effect number uniqueness.
DefiningFX_MODE_KITTas255is fine if no other effect or usermod uses the same slot. Consider confirming it is indeed free to avoid any accidental collisions.
🏁 Script executed:
#!/bin/bash # Description: Searching for existing definitions of FX_MODE_* as 255 across the codebase rg -A 2 "FX_MODE_.*255"Length of output: 596
Effect number uniqueness verified.
The search confirms that the only definition using the value 255 for an effect mode is in
usermods/usermod_v2_KITT/usermod_v2_KITT.hforFX_MODE_KITT; no other effect or usermod defines an FX_MODE with this value. Although the number 255 appears elsewhere (e.g., as a brightness value inwled00/ir.cppand within a string inwled00/FX.cpp), these do not indicate a conflict.
v2 usermod for replicating the effect found on KITT, the car from the 80's TV show Knightrider.
The original effect was in Red, however, the usermod also supports palettes
Has 4 controls:
Similar to Sinelon but uses triangular wave not sine.
Summary by CodeRabbit
New Features
Documentation