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

(T.TimeCheck() - not seting to true after reaching 0 remaining time. #31

Open
WojciechowskiMarek opened this issue Feb 12, 2021 · 5 comments

Comments

@WojciechowskiMarek
Copy link

WojciechowskiMarek commented Feb 12, 2021

My code
https://github.com/WojciechowskiMarek/Timer-for-Ozone-generator/blob/main/main.cpp
line 174, after counting down not setted T.TimeCheck().

Your sincerely
Marek Wojciechowski

@AndrewMascolo
Copy link
Owner

Made a change to the library, please pull the library again.

@WojciechowskiMarek
Copy link
Author

Andrew, all is working fine was problem local with my code. Your code works excelent. Why I'm choose Your library ?
Because You have flag T.TimeChanged it was easy to use in my code. TAke a look at line 293 and 294. When timer is running and I want to stop it I'm using T.SetTimer(0,0,0,0); T.StopTimer();. Do You have in library some elegant function for this purpose ?
Now I have to set up timer for 0 and then stop to get TimeCheck flag set to true ?

@AndrewMascolo
Copy link
Owner

AndrewMascolo commented Feb 13, 2021 via email

@WojciechowskiMarek
Copy link
Author

Hello.

Should be good to handle situation that is interrupted working of timer. For example in my case operator can exit from timer screen into main menu. Now I have to initialize timer with 0 time to get proper state flag T.TimeCheck.
And stop timer with T.StopTimer ??? flag.

@AndrewMascolo
Copy link
Owner

AndrewMascolo commented Feb 15, 2021

boolean TimeCheck() { // output true if timer equals requested time or has passed it.
if(_type)
return remainingSeconds >= stopTimeTotalTime; // Counting UP
else
return remainingSeconds <= stopTimeTotalTime; // Counting DOWN
}

When Counting Down, TimeCheck only returns true when the remaining seconds is less than or equal to the set stop time. So in your case, yes you would need setTimer(0) and stopTimer() together.

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