- :-
Mini-challenge solutions

Program Review: Obstacle Detecting Until Black Line

Hover on any block in the program to view a detailed explanation.
1_RepeatUntil_Block Conditionally sends the program flow back to the start. Lets the flow out of the loop if the sensor's Grayscale value is less than 75 at the beginning of the loop. Robot repeats movements inside the loop until the Color Sensor sees gray darker than the threshold (Black) at the exact moment the loop starts.
2_IfElse2_Block Checks whether the Distance Sensor value is less than '100'. If it is, sends program flow to the 'if'(first) branch. If not, sends program flow to the 'else'(second) branch. Robot makes a decision based on whether there is an object within 10cm.
3_StopMultipleMotors_ Stops motors 1 and 6. Stops the robot if there is no object within 10 cm in front of the Distance Sensor.
5_SetMultipleMotors_ Turns motors 1 and 6 On at 50% power. Starts moving the robot forward. StopMultipleMotors block will need to stop the robot later.