
Re: question about stop()
The stop(); command by default applies a 'brake' command to the motors and stops them in place. This is useful for stopping the NXT motors from coasting past the intended travel point if the program then does other things.
In ROBOTC, the closing brace of task main() (the } at the end of the program) also sends a 'brake' command to all of the motors on the NXT as a safety feature; so in this particular program, removing the stop() command will result in similar behavior then the program with the stop() command. However, it is always good practice to explicitly stop the motors whenever you want them to stop to ensure that the robot does not coast past the desired point of travel.
This code:
Is not the same at this code:
_________________Check out our
Blog! And our
Facebook page!
Need help? Take a look at our
updated help documentation and the
ROBOTC Forums.