The Sleep Command

Using the Sleep Command

The FTC SDK provides a sleep() command in which you can give a desired number of milliseconds to the function and it will cause your thread to sleep for that number of milliseconds. We will be using this command extensively when writing autonomous programs.

sleep(500); //sleeps for 500 ms

Sleep can be useful in auto to wait between doing certain tasks, however, do not use the sleep command in tele-op. It causes the whole thread to sleep and whatever movement the loop last received will continue, causing your robot to go haywire.

While Loop

Last updated