mistergreen:
The problem is attachInterrupt is excepting a function signature of void ()() but I'm passing is a function of signature void (Hall::)()....
FanSpeed::FanSpeed()
{
//****************Constructor****************
setup(14, []() { handleInterrupt(); } // error: 'this' was not captured for this lambda function
// I tried this too
//setup(14, [this]() { handleInterrupt(); }
}
you are going in a circular direction, trying to get the this pointer dragged into the lambda...
again, setup of the ISR takes a pointer to a function of signature void(*)(void), there is no room for any class instance pointer in there!
essentially what my example does is create a function outside of any class and that function then operates on a class/instance... look at Pin2 example here, using my first example above:
mistergreen:
I'm trying to attachInterrupt in a class. I want to attach a non-static member function in the class.
This again
You can't do this. The way that member functions work is that a reference to the instance is passed as a hidden parameter to the function. Interrupts don't have data bundled with them in this way - they save the current status of the chip on the stack and jump to an address, no parameters and whatnot.
You need a plain vanilla function with no arguments. That can be a global, or it can be a static class function. If you want the interrupt to execute against some instance, then you will have to store a reference to that instance somewhere and use it in your ISR.
-- EDIT --
you know, the API could provide this. After all - the interrupt can't be calling the ISR directly because regular C functions have a regular RET on the end of them, not a RETI. The bit than manages attachInterrupt could easily be built to keep a single void pointer.