function work? Does the timer begin as soon as the motor begins to rotate? Or only if it is trying to spin but the encoder isn’t going up? I am trying to make code to fully extend our tower using this function.
My code would look something like this:
Tower.setTimeout(1,vex::timeUnits::sec);
// Tower would be fully extended at encoder value of say 500
Tower.rotateTo(600,vex::rotationUnits::deg,100,vex::velocityUnits::pct); // Try to rotate past the full extension, then time out after it can't reach the top
The timeout is the length of time that the rotateTo call will wait for the motor to reach it’s target position. If the timeout occurs, the motor is sent stop. The timeout only applies to a blocking method like rotateTo, it has no meaning for the non blocking methods such as startRotateTo.
It stays set while the motor instance is valid, so if your motor is a global instance (which it usually will be in VCS) it will retain the value while your program is running.
If you set to 0, it should go back to the default value which is INT32_MAX
If the timeout happens, stop is called with current brake mode.