-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
cannot generate timer events at "minutes" #8
Comments
Make sure you're using the correct integer type for holding the values you expect to handle, and to qualify any constants with appropriate integer suffixes. Use unsigned long for play_time and it should work. For more correctness, also qualify the 1000 constant with UL: play_time_timer.in(play_time * 1000UL, CT_win); |
thanks for the reply. I'll try asap.
…On Fri, 13 Dec 2019 at 09:04, Michael Contreras ***@***.***> wrote:
Make sure you're using the correct integer type for holding the values you
expect to handle, and to qualify any constants with appropriate integer
suffixes <https://en.cppreference.com/w/c/language/integer_constant>.
Use *unsigned long* for *play_time* and it should work. For more
correctness, also qualify the *1000* constant with *UL*:
play_time_timer.in(play_time * 1000UL, CT_win);
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#8?email_source=notifications&email_token=AAK4JWQTEUEJ53QVM2O22WDQYM62RA5CNFSM4JZ5M42KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGZHFEQ#issuecomment-565342866>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAK4JWVCVSBFP5EVUSKKJ6DQYM62RANCNFSM4JZ5M42A>
.
--
Sourceforge: https://sourceforge.net/u/allegfede/
YouTube Channel: https://www.youtube.com/c/v1p3rslab
VIMEO HD videos: http://www.vimeo.com/user1912745/videos
|
This comment has been minimized.
This comment has been minimized.
Repository owner
locked as resolved and limited conversation to collaborators
Jan 5, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, i have to handle events that will occour in minutes (not milliseconds), but i noticed that using this code:
// in the global
auto play_time_timer = timer_create_default();
// in the setup
play_time_timer.in(play_time*1000, CT_win);
// in the loop
play_time_timer.tick();
// and the called procedure
bool CT_win(void *argument){
Serial.print("timer complete!");
return false;
}
works only if play_time if less than 33 seconds (so global delay less than 33000 milliseconds).
I suppose have to deal with the INT limit, but how i can make a minute counting timer?
The text was updated successfully, but these errors were encountered: