added support for m5stick C plus 2
As mentioned above, I added a new target, the M5Stick C PLUS2 with a simple FFT visualiser as a usermod that's enabled by default for it. You can drive the LEDs from any of the data pins with an external power source (haven't tested the Stick's one but I don't recommend it).
Summary by CodeRabbit
-
New Features
- Introduced an audio-reactive visualizer for M5Stick2, delivering dynamic display animations and enhanced backlight control.
-
Documentation
- Updated setup instructions and configuration guidelines to support the new M5Stick2 integration and ensure a seamless user experience.
Hi @huuck
Thanks for your contribution. As the M5 is just a regular esp32 build there is no need to for a change to platformio.ini, please move the examples of how to build your usermod into the readme file of your usermod.
With regards to the usermod itself, it doesn't appear to actually be M5 specific, so it might be better to rename this to be more generic
Hmm... I'm not sure I get it. While it is a regular ESP32, it comes with 2 peripherals attached (the display and mic). Should I move all of the defines for the pins inside the usermod header?
No keep as platformio build flags, but just say in your readme what env to add.
We just don't add every combination of board and usermod to the main platformio.ini file or it would be massive
Ah, amazing. Thanks for explaining, I'll move everything to the usermod and resubmit!
@netmindz Fixed, can you re verify, please? ty!
Yeah, that fixes the issue with platformio.ini
I wonder though if this kinda overlaps with https://github.com/Aircoookie/WLED/pull/4072
Hm, did not know about that PR, should I wait until the merge is live and push again? I've been having some issues with the eTFT driver, maybe this refactor will clear it up.
I wonder though if this kinda overlaps with #4072
Good point - I think the display content is really not specific to the M5StickC2 board, just TFT dimensions might be different for others. The visualizer code might also be added to the generic TFT usermod.
Walkthrough
The pull request introduces a new usermod for the M5Stick2 Visualiser. A header file is added, defining the M5Stick2Visualiser class with methods for TFT display initialization, audio visualization, and JSON-based configuration. The README is updated with detailed hardware setup instructions and PlatformIO configuration for the M5Stick C Plus2. Additionally, the new usermod is registered in the system by updating the usermods list.
Changes
| File(s) | Change Summary |
|---|---|
| usermods/.../M5Stick2_Visualiser.h | Added a new header defining the M5Stick2Visualiser class (inheriting from Usermod) with methods for setup, connectivity, looping, JSON integration, and audio visualization. |
| usermods/.../README.md | Updated documentation with hardware setup, library dependencies, and PlatformIO configuration instructions for the M5Stick C Plus2 implementation. |
| wled00/.../usermods_list.cpp | Registered the new usermod by including the M5Stick2_Visualiser.h header and adding an instantiation in the usermod manager. |
✨ Finishing Touches
- [ ] 📝 Generate Docstrings (Beta)
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
-
I pushed a fix in commit <commit_id>, please review it. -
Generate unit testing code for this file. -
Open a follow-up GitHub issue for this discussion.
-
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:-
@coderabbitai generate unit testing code for this file. -
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:-
@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase. -
@coderabbitai read src/utils.ts and generate unit testing code. -
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format. -
@coderabbitai help me debug CodeRabbit configuration file.
-
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)
-
@coderabbitai pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai generate docstringsto generate docstrings for this PR. (Beta) -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
Hi! I addressed all of the comments, would it be possible to have another go?