I made a struct like this:
typedef struct {
int color[3];
int positions[4];
char init[20];
void (*fn)();
} buttons;
and a variable like this:
button test[1] =
{
{{0,0,0},{0,0,100,100},"getSomething",setSomething}
}
In loop() I call test[i].color, test[i].position normally.
Problems start when I want to execute a function.
I made two attemps, one with string and one with a function statement. With the string I have no problems using a strcmp() but it's not what I want.
I need to know how I can store 2 different functions in the struct and how I can execute.
Thanks in advance!