Help on usermods

@lxkev @ramrubicon7 something to get you started.

https://www.youtube.com/results?search_query=how+to+compile+source+code+in+visual+studio+code
https://www.youtube.com/results?search_query=use+platformio+in+visual+studio+code
https://www.youtube.com/results?search_query=compile+wled+in+platformio

Unfortunately there is no easier way other than start doing it and learn from mistakes.
Use Discord for more real-time answers and help since there are plenty of skilled users on-line there.

As mentioned earlier, help on usermods can be obtained from usermod authors or other users that have successfully implemented them.
I have posted the setup needed for PlatformIO + Visual Studio Code to compile 5 usermods that I modified or created. There is no other thing needed to be done other than create platformio.ini (or platformio_override.ini) entry as shown above. After this is done just click Build (or Upload) menu item in PlatformIO tab.
I am not going to describe how to do things in PIO or VSC since there are plenty of resources on-line, some in linked videos above.

2 Likes

I have being playing with this stuff for the first time today on a try to make my TTGO-T-Display to work with the already built usermod and I just found a way to force the Visual Studio to compile using the usermod.cpp for that specific project.

The instructions of the Readme.md must be followed, however there is a missing part which is that you shall replace the usermod.cpp from the folder wled00 for the usermod.cpp on the usermod library. That’s the trick to make a usermod to work when declaring it as a #defines doesn’t work.

That is not needed for usermods v2.
You should avoid usermod v1 if possible.

That’s the problem with video links above.

I under stand how to install the software
I understand how to compile and upload.

However the last video which tells you about the user mods is version 1.

If you know how to install software and if you know how to compile I bet you can figure out how to change compile parameters. If I was able to comprehend how to write a usermod (or modify one) within a couple of months just by studying supplied ones, you can too. Let alone just use one!

v2 usermods require change in usermods_list.cpp where you #include appropriate usermod .h file (preferably by using/copying provided existing usermods) and creating a usermod .h file itself.
Usermod .h file may contain any or all of the virtual methods defined in fcn_declare.h in usermods section.
What they do is up to you.

There is also an empty usermod_v2_empty.h (with a minimum layout and instructions how to write a usermod) provided, as well as complete example usermod_v2_example.h with readme.md.

3 Likes