Is there any way to pass the pin to a class for initializing the

Is there any way to pass the pin to a class for initializing the controller?

A little background: I’m working on a library where each instance has its own LED strip. At the moment the pin is set through a #define in a “config” header file, but it would be great if it was possible for the end-user to set their own pin either in the class constructor or through a class “begin” function.

I understand that the compiler needs to know the pin at compile-time, and I’ve tried messing around with templates to no avail.

Does anyone have any suggestions?

This subject has come up in the past, along with changing the number of LEDs at run-time, but i cant remember what the answer was.

You may be able to find the post using the community search - YMMV

I tried to do a few searches before posting, but most of the answers said “The pin/type/color order needs to be known at compile-time”, which doesn’t really answer my question. The pin is known at compile-time, I just want to obscure the initialization from the end-user.

I just realized that I could use a switch statement, listed with every possible pin. But that’s ridiculously clunky.

Putting it in a switch statement is exactly what you have to do. The pin/led type can’t be passed in as function/constructor parameters to the underlying controllers.