To simplify the implementation, we would like to use Thread.sleep() in our subsystems for a short period of time. Is this safe? What's the recommended way to implement wait() without using a loop in the opmode.
Announcement
Collapse
No announcement yet.
Is it safe to call Thread.sleep() in LinearOpMode
Collapse
X
-
Is it safe to call Thread.sleep() in LinearOpMode
To simplify the implementation, we would like to use Thread.sleep() in our subsystems for a short period of time. Is this safe? What's the recommended way to implement wait() without using a loop in the opmode.
Tags: None
-
-
If your program doesn't need the thread open you can use the ElapsedTime object as a timer
you could also theoretically use this code as it's the same code from the LinearOpMode class for either of those I recommend you make a method
try { Thread.sleep(milliseconds); } catch (InterruptedException e) { Thread.currentThread().interrupt(); }
Comment
Comment