Knowledge Base

Drive until Distance block (Adventure)

output-onlinepngtools__231_.pngspike_robot.jpgThis block works for EV3 and SPIKE Prime!

mceclip0.png

This block drives the robot forward or  backward until the Distance Sensor detects an object a specific distance away. Use this block to stop the robot's drive missions where you're not sure about the exact drive distance relative to an object, and cannot rely on a specific number in a Drive Distance block.

Code Example:

mceclip0.png

drive_until_distance_0.5.gif

Note how the robot stops when the distance from the obstacle is 0.49m - less than 0.5 like the < symbol says.

Was this article helpful?
0 out of 0 found this helpful

Comments

Please sign in to leave a comment.

Powered by Zendesk