We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am tryin to execute a method after X ammount of seconds (Sort of pausing the program before actually calling the method to run. I am doing this outside draw() therefore it doesn't run constantly. I want the program to wait 5 seconds and then call the function.
This is the way I am trying to implement it:
int savedTime;
int totalTime = 5000;
void objectprocess(){
int passedTime = millis() - savedTime;
if (passedTime > totalTime){
changeImg();
}
}
For some reason the method changeImg() is never called. Probably I need to fix something in the way the timer for the pause is working.
Many thanks for your time and help guys !
Answers
Hard to tell, as we don't see how you set savedTime, how you call objectprocess, etc.
A useful debug "tool" is println(): print out the value of variables and see what happens.