Help with terms in vex iq API

Can anyone explain to me the difference between Motor.brake, and Motor.hold? How do these differ from setting motor speed to 0? (This question applies to both python and vexcode. )

In vexcode, what’s the difference between gyro rotation and gyro heading?

Is there documentation somewhere that clearly explains this?


Not sure how this works in iq but in v5 setting the motor to brake it will try and stop movement from happening. When you set it to hold it will actively try to hold itself in the position that it was set into hold at. In the off or coast setting the motor will do nothing. I have no answer for your other question as I’ve never used gyro in iq or v5.

1 Like

@Loco_25146A’s description of the brake modes is correct.

“heading” will always be between 0 and 360 (i.e., it resets after each complete rotation); “rotation” is unbounded. So if the robot makes two full clockwise turns, and ends up facing the same direction it was facing when the program was started, the heading will be 0 but the rotation will be 360.

VEXcode’s built-in help is very useful – click on the question mark icon in the top right, then click on any block or function in the left sidebar.

If you’re programming in C++, I maintain a set of Doxygen docs which are automatically generated from VEXcode’s C++ header files. The built-in help is a lot more descriptive than my docs, but there is some advanced functionality available that the built-in help won’t tell you about because it’s not exposed in the sidebar.