Thanks, that helps. But now I need to pass "this" as an argument to my function.
The function is specified in the PinChangeInt.h like this:
typedef void (*PCIntvoidFuncPtr)(void);
So I have tried to do this:
typedef void (*PCIntvoidFuncPtr)(void *);
So that I can do this in my Class:
PCintPort::attachInterrupt(pinA, interruptWrapper((void *) this), CHANGE);
but I get this error:
/Users/schwager/Documents/Arduino/libraries/AdaEncoder/AdaEncoder.cpp: In member function 'void AdaEncoder::attachInterrupt(int, int)':
/Users/schwager/Documents/Arduino/libraries/AdaEncoder/AdaEncoder.cpp:68: error: invalid use of void expression
if I do:
PCintPort::attachInterrupt(pinA, &interruptWrapper((void *) this), CHANGE);
I get this:
/Users/schwager/Documents/Arduino/libraries/AdaEncoder/AdaEncoder.cpp: In member function 'void AdaEncoder::attachInterrupt(int, int)':
/Users/schwager/Documents/Arduino/libraries/AdaEncoder/AdaEncoder.cpp:68: error: lvalue required as unary '&' operand
I can't figure out how to pass
this through my static wrapper so as to open up the world of possibilities to me! I need it so that I know which object the interrupt applies to.
Thanks again.