-
Notifications
You must be signed in to change notification settings - Fork 20
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
Countdown stops and how to repeat after a long period #30
Comments
I haven’t touched this library in years but I’ll see what I can do.
- Andrew
…Sent from my iPhone
On Feb 3, 2021, at 9:50 AM, evermore99 ***@***.***> wrote:
Dear Andrew, thanks for the great library!
Could you add days into the program or what is the limit to the amount of hours? And how do I make the code repeat after 36:00:00 ?
I’ll like to integrate this in the library. Is such a thing possible?
many thanks for taking your time reading this.
best regards
Bastiaan
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Hi Andrew
I found about the repeat part and I just added it into my else statement of
the timeischanged. I am using my reset button on my teensy as a reset.
I’ll try to make a reset button with the reset function with a longpress
hold. To see if it makes a difference.
Best regards
Bastiaan
Op wo 3 feb. 2021 om 16:54 schreef AndrewMascolo <[email protected]>
… I haven’t touched this library in years but I’ll see what I can do.
- Andrew
Sent from my iPhone
> On Feb 3, 2021, at 9:50 AM, evermore99 ***@***.***> wrote:
>
>
> Dear Andrew, thanks for the great library!
>
> Could you add days into the program or what is the limit to the amount
of hours? And how do I make the code repeat after 36:00:00 ?
>
> I’ll like to integrate this in the library. Is such a thing possible?
>
> many thanks for taking your time reading this.
>
> best regards
>
> Bastiaan
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub, or unsubscribe.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARH2AEHKILTMEONTNB5U7H3S5FWU3ANCNFSM4XA7QUNQ>
.
|
Hi, it’s definitely possible to add days to this library but that would require a rewrite of the logic. Right now you can only set the timer for about 18 hours as that is the largest value that can be stored in a 32bit unsigned integer. The hours minutes and seconds are all converted into seconds and then decremented. If I were to add days, this would need to be changed, which can also impact precision. Although if you need precision then I would advise getting a Real Time Clock module instead. This way you keep precision and keep the rest of your code running smoothly. I will play around with the library over the weekend and add in days. |
Hi Andrew,
Thanks for pointing that out with the 32bit uint.
I have tested the library on 36:00:00 and it does the countdown perfectly.
I don’t know however what will happen if the countdown is reaching 36:00:00
hours or before.
can you run down the countdown library faster to see if there is a unint
overflow?
Best regards
Bastiaan
Op do 4 feb. 2021 om 05:49 schreef AndrewMascolo <[email protected]>
… Hi, it’s definitely possible to add days to this library but that would
require a rewrite of the logic. Right now you can only set the timer for
about 18 hours as that is the largest value that can be stored in a 32bit
unsigned integer. The hours minutes and seconds are all converted into
seconds and then decremented. If I were to add days, this would need to be
changed, which can also impact precision. Although if you need precision
then I would advise getting a Real Time Clock module instead. This way you
keep precision and keep the rest of your code running smoothly.
I will play around with the library over the weekend and add in days.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARH2AEBNQ6OL4WCBBXXL22DS5IRNRANCNFSM4XA7QUNQ>
.
|
Added Days |
Cool many thanks!
I’ll test it:)
thanks for the update:), was it hard? uint overflow problem?
Best regards
Bastiaan
Op zo 7 feb. 2021 om 03:28 schreef AndrewMascolo <[email protected]>
… Added Days
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARH2AEFAUHF4J22SCJIWNLTS5X3GJANCNFSM4XA7QUNQ>
.
|
Ok i get an error saying that:
Unsigned int _S = (seconds/60), _M =minutes/60; expected unqualified is
before numeric constant
And once
_M was not declared in this scope
I think unsigned int is missing, at the _M, i think I have some conflicts
with other libraries because they use the same syntax/macros for _S
Best regards
Thanks for the help!
Bastiaan
Op zo 7 feb. 2021 om 08:53 schreef BP <[email protected]>
… Cool many thanks!
I’ll test it:)
thanks for the update:), was it hard? uint overflow problem?
Best regards
Bastiaan
Op zo 7 feb. 2021 om 03:28 schreef AndrewMascolo ***@***.***
>
> Added Days
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#30 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ARH2AEFAUHF4J22SCJIWNLTS5X3GJANCNFSM4XA7QUNQ>
> .
>
|
You are more than welcome to change the library to suite your needs.
- Andrew
…Sent from my iPhone
On Feb 8, 2021, at 4:07 PM, evermore99 ***@***.***> wrote:
Ok i get an error saying that:
Unsigned int _S = (seconds/60), _M =minutes/60; expected unqualified is
before numeric constant
And once
_M was not declared in this scope
I think unsigned int is missing, at the _M, i think I have some conflicts
with other libraries because they use the same syntax/macros for _S
Best regards
Thanks for the help!
Bastiaan
Op zo 7 feb. 2021 om 08:53 schreef BP ***@***.***>
> Cool many thanks!
>
> I’ll test it:)
>
> thanks for the update:), was it hard? uint overflow problem?
>
> Best regards
>
> Bastiaan
>
>
>
> Op zo 7 feb. 2021 om 03:28 schreef AndrewMascolo ***@***.***
> >
>
>> Added Days
>>
>> —
>> You are receiving this because you authored the thread.
>> Reply to this email directly, view it on GitHub
>> <#30 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/ARH2AEFAUHF4J22SCJIWNLTS5X3GJANCNFSM4XA7QUNQ>
>> .
>>
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Dear Andrew, thanks for the great library!
Could you add days into the program or what is the limit to the amount of hours? And how do I make the code repeat after 36:00:00 ?
I’ll like to integrate this in the library. Is such a thing possible?
many thanks for taking your time reading this.
best regards
Bastiaan
The text was updated successfully, but these errors were encountered: