Knowledge Base

Wait Until Sensor Distance block (Adventure)

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

 

mceclip0.png

This block pauses program execution until the Distance Sensor (ultrasonic sensor) senses an obstacle (or the lack of one!) located a specific distance from it. 

Code Example:

mceclip1.png

In this program, the robot will first drive forward until the distance from it to an obstacle is less than 0.5m.

The Wait Until Sensor Distance block, which is set to detect a distance greater than 0.5m, makes the robot wait until that condition is met (meaning, the obstacle has moved out of the way and the Distance Sensor detects a bigger distance between the robot and some other obstacle) before the program moves on to execute the next command, which is to drive forward 2m.

Here's what it looks like:

May271029.gif

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

Comments

Please sign in to leave a comment.

Powered by Zendesk