Skip to content
Discussion options

You must be logged in to vote

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.index to provide per pixel "parameters". If you don't need per pixel parameters, then animationState doesn't need to be an array, it can just be a struct.

the snippet from that example using lambda support ...

// we must supply a function that will define the animation, in this example
// we are using "lambda expression" to de…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by Makuna
Comment options

You must be logged in to vote
1 reply
@Makuna
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants