Im using C++ to create a timer. Ive look up the internet but not find anything that i can understand.Here is my code:
struct Timer{
bool timerRunning;
int time;
void Timer_Service(void* param){
timerRunning = true;
time = 0;
while(timerRunning){
wait(10);
time += 10;
}
}
void startTimer(){
Timer_Service((void*)"PROS");
pros::Task timerservice(Timer_Service,(void*)"PROS");// <- error here "reference to non-static member function must be called"
}
void stopTimer(){
timerRunning = false;
}
int getTime(){
return time;
}
};
How do i solve this error?
BTW pros::Task timerservice(Timer_Service,(void*)"PROS");
is a function that initializes a multitask loop.
Thanks all for your kind help.