Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I create a class with its own timer #76

Open
sevketk opened this issue Oct 17, 2020 · 1 comment
Open

How can I create a class with its own timer #76

sevketk opened this issue Oct 17, 2020 · 1 comment

Comments

@sevketk
Copy link

sevketk commented Oct 17, 2020

I need a one class , have a timer. in class method can start, stop timer.

#include <DueTimer.h>

void RGBmatrixPanel::begin(void) {
   Timer3.attachInterrupt(updateDisplay);
   Timer3.start(250);
} 
void RGBmatrixPanel::updateDisplay() {
    if(something doing){
          Timer3.stop();
    }
}

But i get error on arduinodue

E:\kutuphane\belgelerim\Arduino\libraries\RGB-matrix-Panel-master\RGBmatrixPanel.cpp: In member function 'void RGBmatrixPanel::begin()':
E:\kutuphane\belgelerim\Arduino\libraries\RGB-matrix-Panel-master\RGBmatrixPanel.cpp:86:41: error: no matching function for call to 'DueTimer::attachInterrupt(<unresolved overloaded function type>)'
     Timer3.attachInterrupt(updateDisplay);
                                         ^
E:\kutuphane\belgelerim\Arduino\libraries\RGB-matrix-Panel-master\RGBmatrixPanel.cpp:86:41: note: candidate is:
In file included from E:\kutuphane\belgelerim\Arduino\libraries\RGB-matrix-Panel-master\RGBmatrixPanel.h:26:0,
                 from E:\kutuphane\belgelerim\Arduino\libraries\RGB-matrix-Panel-master\RGBmatrixPanel.cpp:3:
E:\kutuphane\belgelerim\Arduino\libraries\DueTimer-master/DueTimer.h:84:12: note: DueTimer& DueTimer::attachInterrupt(void (*)())
  DueTimer& attachInterrupt(void (*isr)());

how to use in a class duetimer library?

@ivanseidel
Copy link
Owner

ivanseidel commented Oct 18, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants