Hi Guys,
Just a C question really. I have a class which owns an IntervalTimer object, which will be used to call a function from that class. It looks something like this:
Header
.cpp
Compiler gives me the following error message (using visual micro):
Any ideas how to resolve this? Function pointers are something that are relatively new to me.
-- Iestyn.
Just a C question really. I have a class which owns an IntervalTimer object, which will be used to call a function from that class. It looks something like this:
Header
Code:
class IRTrans
{
private:
IntervalTimer txTimer;
void isr();
public:
void init();
};
extern IRTrans IRtx;
.cpp
Code:
void IRTrans::init()
{
txTimer.begin(isr, 100);
}
void IRTrans::isr()
{
//Whatever.
}
IRTrans IRtx;
Compiler gives me the following error message (using visual micro):
Code:
Compiling 'phaserp_test_sketch' for 'Teensy 3.1'
IRTrans.cpp:In member function 'void IRTrans::send(uint8_t, uint8_t, bool)'
IRTrans.cpp:114:50: error: no matching function for call to 'IntervalTimer::begin(<unresolved overloaded function type>, double)'
IRTrans.cpp:candidates are
WProgram.h:In file included from
Arduino.h:from
IRTrans.h:from
IRTrans.cpp:from
IntervalTimer.h:ISR, unsigned int)
IntervalTimer.h:ISR {aka void (*)()}'
IntervalTimer.h:ISR, int)
IntervalTimer.h:ISR {aka void (*)()}'
IntervalTimer.h:ISR, long unsigned int)
IntervalTimer.h:ISR {aka void (*)()}'
IntervalTimer.h:ISR, long int)
IntervalTimer.h:ISR {aka void (*)()}'
IntervalTimer.h:ISR, float)
IntervalTimer.h:ISR {aka void (*)()}'
IntervalTimer.h:ISR, double)
IntervalTimer.h:ISR {aka void (*)()}'
Error compiling
Any ideas how to resolve this? Function pointers are something that are relatively new to me.
-- Iestyn.