This block works for Ruby Robot!
The Wait Until block holds off on the execution of the next code of the program, until the conditions placed into its Boolean Comparison block are met. Alternatively, you can remove the comparison block and replace it with any Boolean type block.
In this example code, the robot will drive forward at full speed until the left color sensor registers the color "Green". Only after it has reached the green line drawn on the floor, the robot will stop and turn to 90 degrees.
Here's another example: the robot will drive forward at full speed until its front ultrasonic sensor registers a distance that is smaller than or equal to 85 cm. Only when that happens, will the robot stop and drive backward 100 cm.
Comments
Please sign in to leave a comment.