I would need to setup a timer in a class constructor with a non-static class member, using the TimerOne library.
How can I do that, given the attachInterrupt function is expecting a free function as an argument?
Thanks.
Thanks,
Luca
How can I do that, given the attachInterrupt function is expecting a free function as an argument?
Thanks.
Code:
Foo::Foo() {
Timer1.initialize(1000);
Timer1.attachInterrupt(update);
Timer1.start();
}
void Foo::update() {
// do something
}
error: invalid use of non-static member function 'void Foo::bar()'
Thanks,
Luca