Knowledge Base

Drive until Distance block (Adventure)

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


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:



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


Please sign in to leave a comment.