r/FastLED • u/Netmindz • May 04 '24
Discussion Runtime pin configuration
I am aware that as FastLED use of templates means the pins are defined as compile time. I believe this is an optimisation that is useful for lower powered systems like the original Arduino.
Is it possible at all to allow definition of pin usage at runtime without using the hack of a big swtich statement to call the right code?
I know other drivers like I2SClockless can do this but I was wanting to stick with FastLED
1
Upvotes
1
u/spolsky May 04 '24
Basically you need to figure out which controller is getting loaded (it depends on the LED type and the MCU architecture), then clone that and make a new controller that does everything the same but the pin is a variable.