A 16 Minute Timer

0 views
Skip to first unread message

Claribel Szwaja

unread,
Aug 4, 2024, 1:40:57 PM8/4/24
to florinreli
Setthe hour, minute, and second for the online countdown timer, and start it. Alternatively, you can set the date and time to count days, hours, minutes, and seconds till (or from) the event. The timer triggered alert will appear, and the pre-selected sound will be played at the set time.

I don't know if Timer1 can deal with a period as long as 1 minute but you would certainly need to "mess with the clock dividers". All the details are in the relevant Atmel datasheet - you don't say which Arduino you are using.


First of all, PLEASE read the How To Use This Forum thread before you post. I had to do alot of googling, which most people WILL NOT DO, simply because you failed to tell us basic things about your problem, such as:

The library you were using, and

Your code, which would have showed me the library you were using


...which is EXACTLY what millis() does, except it uses milliseconds as the unit instead of seconds. You have replaced one problem by exactly the same problem except you have used another precious timer which now cannot be used for PWM or servos.


However, OP did not specify whether or not perfect timing was critical. 1 or 2 uS or even mS may not be important, but if they have alot of blocking code and 1 minute is fairly important, then interrupts are the way to go. OP will decide what is right for their code.


Because if I did it that way I would be continuously polling for a few different things in my loop() and it may start degrading performance.

If I use a 1 minute interrupt then I am only polling for some of those things in my loop function once per minute as necessary.


I have never mucked around with the pre-scalers before so I had no clear idea how they work, how to use them or their limitations. Apparently I chose the wrong key words in my google search on how to set long interrupts.


Ps991:

I posted code above showing you how to use the prescalers and that code works if you want it to check every 1 minute. Did you miss that or are you saying that it still doesn't work with your code?


I could use a timer and set its interval to 1000. Then within its tick event, I could check the clocks current minute against a variable that I set, if the minute has changed then run my code. This worries me because I am making my computer do a check every 1 second in order to carry out work every 1 minutes. Surely this is ugly ?


Simply compare the value of Environment.TickCount or DateTime.Now to the last stored time (the previous 'minute tick'), and you should have a reasonably precise solution. The resolution of these two time values is about 15ms, which should be sufficient for your purposes.


Do note however that the interval of the Timer control is not guaranteed to be that precise or even anywhere now, since it runs on the Windows message loop, which is tied in with the responsiveness of the UI. Never rely on it for even moderately precise timing - though it is good enough for firing repeating events where you can check the time using a more sensitive method such as one of the two given above.


A clock implementation would simply create the class with a interval of 1 second and listen to the event. Be wary though that this is a real-time clock, if the tick event takes longer than the interval to finish you'll notice that the clock will try and catch up to real-time this will cause a burst of tick events being raised.


You would fire the short interval timer only until the desired start time of the main interval timer is reached. Once the initial time is reached, the second main interval timer can be activated, and the short interval timer can be deactivated.


Alternatively, you could sleep to pause execution until it times out which should be close to your desired time. This will only wake the computer when the sleep finishes so it'll save you CPU time and let the CPU power down between processing events.


Use a timer set to run every second (or millisecond, whatever your accuracy threshold is), and then code the method to run your functionality if and only if the current time is within that threshold past the "on the minute" point.


What I'm using for scheduled tasks is a System.Threading.Timer(System.Threading.TimerCallback, object, int, int) with the callback set to the code I want to execute based on the interval which is supplied in milliseconds for the period value.


1 minute timer to set alarm for 1 minute minute from now.Online countdown timer alarms you in one minute. To run stopwatch press "Start Timer" button. You can pause and resume the timer anytime you want by clicking the timer controls. When the timer is up, the timer will start to blink.


I am trying to figure out the limit between the free offerings and the enterprise. I heard that there was a 20 minute limit but what does that mean? I do do not see any counters in my account nor projects.


I just started a project with about 540 images. so far so good. I was curious if the project will just fail if it gets too large? FYI, this is a dorky meaningless project. We would never ask for extra time on this. I would just like to know how far I can go.


The 20-minutes limit applies per job.

You can reach this limit when your dataset is pretty big and/or your NN architecture is complex and needs a lot of epochs to converge properly. Most of the time it happens on Object Detection projects but I also have seen the limits been reach on image classification and audio projects sometimes.


Double-tapping the screen should not make the timer appear. While a countdown would appear on the lock screen if you are using the timer, the app itself would not appear in that case. I cannot think of any other reason this would magically appear on the lock screen.


That is a Siri Suggestion. That can appear if you have Siri Suggestions turned on in Settings and the time that it appears is close to a time that you used a 1 minute timer in the past. You can go into Settings>Siri and turn off suggestions if you wish.


I would like to use LPTIM1 on my STM32L0 to make it wake up (the micro is in Stop Mode) after 5 minutes but I don't know what is the best configuration to do that. Currently I have the configuration below.


if this timer is your only option, set up the mcu to wake up at certain interval, like roll-over. In the isr, increment a counter and test if certain number of roll-overs has been achieved. Essentially that counter forms your most significant bits of the timer.

3a8082e126
Reply all
Reply to author
Forward
0 new messages