|
I was wondering how I could add an extra parameter to an animation. Here is an example: Is there a way to parameterize Thanks for any pointers in advance! (Fantastic library, BTW!) |
Replies: 4 comments 1 reply
|
what hardware platform are you using? With some you get modern c++ support for lambda functions. If you look at the example "NeoPixelAnimation", it demonstrates both models, without STL (like you list above using animationState), and with STL using lambda inline callback where the compiler captures any parameters for us. Note that the example is just using the the snippet from that example using lambda support ... Reviewing that example, all parameters must either be captured in the |
|
Thanks for the quick answer! I'm not sure if I understand it though... My platform is an ESP32-S3. |
|
Yes, I haven't used lambda yet, I am looking into it now. Thanks for the explanation/pointers - more than I expected. Much appreciated! |
|
Finally got it to work. Learnt lambdas on the way. Thanks again for your patience and again for this awesome library!!!!! |
what hardware platform are you using? With some you get modern c++ support for lambda functions. If you look at the example "NeoPixelAnimation", it demonstrates both models, without STL (like you list above using animationState), and with STL using lambda inline callback where the compiler captures any parameters for us.
Note that the example is just using the
param.indexto provide per pixel "parameters". If you don't need per pixel parameters, thenanimationStatedoesn't need to be an array, it can just be a struct.the snippet from that example using lambda support ...