![]() |
Timer resets when resumed
Hi everyone!
I have recently run into an interesting issue, it appears that the timer (edu.wpi.first.wpilibj.Timer) resets, when you .stop() and then .start(). Is there a different timer I should be using or a better way to implement the one I have? I am looking for it to resume exactly where it left off, closer to a pause/resume than a start/stop. Thanks for the help! |
Re: Timer resets when resumed
I don't know if there is a pause sort of thing. You could try setting an integer equal to the value of the timer before you stop it, and setting the value of the timer equal to the variable after you restart it. Not sure if that would work, but it's a thought!
|
Re: Timer resets when resumed
Thanks for the reply! I had previously considered this, however unless I'm mistaken, there also is no Set() method.
|
Re: Timer resets when resumed
Quote:
Code:
|
Re: Timer resets when resumed
Interesting! Must be an issue with how I use it...unfortunately I don't have the code in front of me right now, I'll post it later today. Thanks for the help!
|
Re: Timer resets when resumed
Ok, after doing testing I have narrowed down the timer reset to the line
Code:
timer.start();Code:
/*I have actually solved my problem using an offshoot of what @legts suggested. Thanks for the help! |
| All times are GMT -5. The time now is 01:39. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi