sstaub / Ticker

Ticker library for Arduino
MIT License
192 stars 37 forks source link

function isn't a type name #13

Closed AlexFundorin closed 5 years ago

AlexFundorin commented 5 years ago

When I'm declaring a timer inside main.cpp, everything is fine. Yet, as soon as I try to declare it inside a class, I get the following. https://i.imgur.com/Kk6i9Uy.png

void blank(){};
Ticker timer1(blank, 1);
sstaub commented 5 years ago

Were did you declare the function blank? In the screenshot the declaration were comment out.

AlexFundorin commented 5 years ago

I tried declaring it in several places: main.cpp before loop main.cpp before ticker include inside the class (header file) right before the timer object inside the same header file, but as a class function outside the class itself.

sstaub commented 5 years ago

It sounds like a generell problem of nested classes. You should look in the web for it.

AlexFundorin commented 5 years ago

Thanks for the suggestion. For those, who'd encounter the same situation and doesn't need callback functionality, there's a Chrono library, which is working fine in the same conditions.