Skip to main content

Questions tagged [lambda]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
1k views

Using lambdas as callback functions

Using the Ticker library for the ESP32, how can I use a lambda as an argument to the attach method? tickerSystemManager.attach(1000, [&](){ systemManager->sync(); }); Attempting to use the ...
Matt Clark's user avatar
1 vote
1 answer
5k views

How do I use lambda functions in Arduino?

I want to pass a lambda function as an argument to a method. Example: T reduce(const T initial, const std::function<T(T, T)> acc) { T value = initial; for (size_t i = 0; i < S; ++i) { ...
Arseni Mourzenko's user avatar
0 votes
1 answer
338 views

Use callbacks in Arduino with pointers to functions (will functions persist in memory?)

As I been learning Arduino (micro controllers, c++, etc) I have learned that memory is very limited. I already understand how memory works when it comes to variables. But I do not understand how ...
Tono Nam's user avatar
  • 938