Open WojciechowskiMarek opened 3 years ago
Made a change to the library, please pull the library again.
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 ?
Nothing elegant no, but if you want something added, let me know.
Sent from my iPhone
Sent from my iPhone
On Feb 13, 2021, at 12:01 PM, WojciechowskiMarek notifications@github.com wrote: 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 ?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
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.
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.
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