Questions tagged [callbacks]
This refer to the call back procedure in computer programming.
21 questions
0
votes
1
answer
186
views
How do I write efficient callback functions on a Teensy 4.0?
I am looking at refactoring my code by implementing callback functions in order to be able to reuse the abstract logic of other functions/classes.
However, I feel I need to learn more about the limits ...
1
vote
2
answers
229
views
Array of Functions
I'm new to C++. How to make a menu without if() {} else {} & switch() case?
I made a menu on an array, but for some reason it doesn't compile. How to correct it?
typedef void (*cbd)(uint8_t, ...
-1
votes
1
answer
121
views
Share interrupt service between class
I would like to share interrupt routine between class. I followed this tutorial.
But I need to call a member function in callback function, I have the issue :
This is my code :
Timer.h
static void (*...
0
votes
1
answer
1k
views
Passing a method pointer
I created a small library, which takes a callback function:
MyClass::add_callback(bool (*callback_function)(), byte behaviour) {
// ...
bool result = callback_function();
// ...
}
So far, I'm ...
0
votes
1
answer
463
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 ...
1
vote
2
answers
2k
views
Callback functions when using a class
This question is somewhat similar to How to pass non-static class member to callback?, but there are a few differences, especially since a lot of my uses have "interesting" additional complexities. I'...
0
votes
1
answer
880
views
Using timer classes within classes
I am trying to develop a class for a pump that works on a stepper motor, it should be simple but its not working the way I thought it would. Once I move the timer object into the class the code wont ...
1
vote
2
answers
4k
views
ESP8266 ASyncTCP class example
I am new to ESP programming on Arduino, as before I was developing on eLua. There were some memory problems in Lua, so I decided to move to Arduino.
After looking at some examples, I found a library ...
6
votes
2
answers
12k
views
User callback functions
I want to write a class that allows the user to attach his own function to a member function that listens for messages coming from a wireless module, so that the user's function can be called ...
5
votes
1
answer
3k
views
Non-blocking MQTT library
Are there any MQTT libraries that do not block while connecting?
I'm currently using PubSubClient, and the connection part contains this code:
https://github.com/knolleary/pubsubclient/blob/master/...
0
votes
4
answers
982
views
Array of Strings and Callbacks
I am trying to create an array of structs that contain pairs of Strings and Callbacks the problem I am having is assigning the callback function. I have the following code:
#define UI_ROUTINE_ITEMS ...