Possible Duplicate:
How do you pass a member function pointer?
So I've been writing some libraries for Arduino to trim down a rather large sketch I've been working on. Everything is working so far, except for in the constructor in one of my classes. I use it to initialise any variables, pin modes and attaching interrupts. The problems come in when I try to attach interrupts, I have the functions declared and defined in my class, and whether I attach them in the Arduino sketch in the setup() block, or if I do it in my library in the constructor, I get this error:
argument of type 'void (RotaryEncoders::)()' does not match 'void (*)()'
The basic structure of the code is as follows:
RotaryEncoders::RotaryEncoders() {
//Initialise some variables
//Set up some pin modes
attachInterrupt(2, doRedEncoder, CHANGE);
}
void RotaryEncoders::doRedEncoder() {
//Some code, blah blah blah
}
I assume that when you do this purely within the Arduino IDE, the tools do something to the functions in memory to make it work properly. I think the solution is simple but I don't see it :S Thanks :D