- :-
Mini-challenge solutions

Program Review: Backwards Driving Assistance

Hover on any block in the program to view a detailed explanation.
1_WaitUntil_ Stops the program from processing additional commands until the Up-E button value is '1' Robot waits until Up-E button is pressed before continuing the program.
2_ResetTimer_ Resets the time value on timer 'T1' to '0'. Starts the timer 'T1'
3_RepeatUntil_ Conditionally sends the program flow back to the start. Lets the flow out of the loop if the timer's value is greater or equal to '60' (at the beginning of the loop). Robot repeats movements inside the loop until the timer has been running for more than 60 seconds.
4_IfElse2_FIRST IF STATEMENT Checks whether the joystick value from Up-F button is '1'. If 'yes', program flow is sent to the 'if'(first) branch. If 'no', program flow is sent to the 'else'(second) branch. Robot makes a decision based on whether Up-F button is pressed.
5_StopMultipleMotors_ Turn rightMotor and leftMotor On at 100% power. Starts moving the robot foward. StopMultipleMotors block will need to stop the robot later.
7_IfElse3_SECOND IF STATEMENT Checks whether the joystick value from Down-F button is '1'. If 'yes', program flow is sent to the 'if'(first) branch. If 'no', program flow is sent to the 'else'(second) branch. If Up-F is not pressed, robot makes a decision based on whether Down-F button is pressed.
8_StopMultipleMotors_ Turn rightMotor and leftMotor On at -100% power. Starts moving the robot backward. StopMultipleMotors block will need to stop the robot later.
10_TankControl_ Takes input values from Joystick D(right) and A(left) and applies it as motor power to the motors. Uses input from the controller joystick to drive the robot's motors.
11_ArmControl_ If Up-L button is pressed, drive armMotor at positive 75% power. If Down-L button is pressed, drive armMotor at negative 75% power. Uses input from Up-L and Down-L buttons to control the robot arm.
12_ArmControl_ If Up-R button is pressed, drive armMotor at positive 75% power. If Down-R button is pressed, drive armMotor at negative 75% power. Uses input from Up-R and Down-R buttons to control the robot claw.

Program Review: Full Button Control

  • The program shown below is a sample solution to the Full Button Control Mini-Challenge from Operator Assist 3.
  • The sample solution binds group F buttons for straight movements (forward, backward), and group L buttons for turns (right turn, left turn), but any other buttons can be used.
Hover on any block in the program to view a detailed explanation.
1_WaitUntil_ Stops the program from processing additional commands until the Up-E button value is '1' Robot waits until Up-E button is pressed before continuing the program.
2_ResetTimer_ Resets the time value on timer 'T1' to '0'. Starts the timer 'T1'
3_RepeatUntil_ Conditionally sends the program flow back to the start. Lets the flow out of the loop if the timer's value is greater or equal to '60' (at the beginning of the loop). Robot repeats movements inside the loop until the timer has been running for more than 60 seconds.
4_IfElse2_FIRST IF STATEMENT Checks whether the joystick value from Up-F button is '1'. If 'yes', program flow is sent to the 'if'(first) branch. If 'no', program flow is sent to the 'else'(second) branch. Robot makes a decision based on whether Up-F button is pressed.
5_StopMultipleMotors_ Turn rightMotor and leftMotor On at 100% power. Starts moving the robot foward. StopMultipleMotors block will need to stop the robot later.
7_IfElse3_SECOND IF STATEMENT Checks whether the joystick value from Down-F button is '1'. If 'yes', program flow is sent to the 'if'(first) branch. If 'no', program flow is sent to the 'else'(second) branch. If Up-F is not pressed, robot makes a decision based on whether Down-F button is pressed.
8_StopMultipleMotors_ Turn rightMotor and leftMotor On at -100% power. Starts moving the robot backward. StopMultipleMotors block will need to stop the robot later.
10_IfElse_THIRD IF STATEMENT Checks whether the joystick value from Up-L button is '1'. If 'yes', program flow is sent to the 'if'(first) branch. If 'no', program flow is sent to the 'else'(second) branch. If Up-F and Down-F are not pressed, robot makes a decision based on whether Up-L button is pressed.
11_SetMotor_ Turn rightMotor On at -50% power. Starts turning the robot to the right by driving the right side of the robot backward.
12_SetMotor_ Turn rightMotor On at 50% power. Starts turning the robot to the right by driving the left side of the robot forward.
14_IfElse2_FORTH IF STATEMENT Checks whether the joystick value from Up-L button is '1'. If 'yes', program flow is sent to the 'if'(first) branch. If 'no', program flow is sent to the 'else'(second) branch. If Up-F, Down-F, and Up-L are not pressed, robot makes a decision based on whether Up-L button is pressed.
15_SetMotor_ Turn rightMotor On at 50% power. Starts turning the robot to the left by driving the right side of the robot forward.
16_SetMotor_ Turn rightMotor On at -50% power. Starts turning the robot to the left by driving the left side of the robot backward.
18_StopMultipleMotors_ Stops rightMotor and leftMotor If NONE of the buttons (Up-F, Down-F, Up-L and Down-L) are pressed, stops the robot.

Program Review: Advanced Automatic Pickup

Hover on any block in the program to view a detailed explanation.
1_WaitUntil_ Stops the program from processing additional commands until the Up-E button value is '1' Robot waits until Up-E button is pressed before continuing the program.
2_ResetTimer_ Resets the time value on timer 'T1' to '0'. Starts the timer 'T1'
3_RepeatUntil_ Conditionally sends the program flow back to the start. Lets the flow out of the loop if the timer's value is greater or equal to '60' (at the beginning of the loop). Robot repeats movements inside the loop until the timer has been running for more than 60 seconds.
4_IfElse2_FIRST IF STATEMENT Checks whether the joystick value from Up-F button is '1'. If 'yes', program flow is sent to the 'if'(first) branch. If 'no', program flow is sent to the 'else'(second) branch. Robot makes a decision based on whether Up-F button is pressed.
5_StopMultipleMotors_ Turn rightMotor and leftMotor On at 100% power. Starts moving the robot foward. StopMultipleMotors block will need to stop the robot later.
7_TankControl_ Takes input values from Joystick D(right) and A(left) and applies it as motor power to the motors. Uses input from the controller joystick to drive the robot's motors.
8_ArmControl_ If Up-L button is pressed, drive armMotor at positive 75% power. If Down-L button is pressed, drive armMotor at negative 75% power. Uses input from Up-L and Down-L buttons to control the robot arm.
9_ArmControl_ If Up-R button is pressed, drive armMotor at positive 75% power. If Down-R button is pressed, drive armMotor at negative 75% power. Uses input from Up-R and Down-R buttons to control the robot claw.
11_IfElse2_SECOND IF STATEMENT Checks whether the joystick value from Down-F button is '1'. If 'yes', program flow is sent to the 'if'(first) branch. If 'no', program flow is sent to the 'else'(second) branch. If Up-F is not pressed, robot makes a decision based on whether Down-F button is pressed.
12_SetMotor_ Turn armMotor On at -50% power. Starts lowering the robot arm.
13_WaitUntil3_ Stops the program from processing additional commands until the Bumper Sensor value equals to '1'. Robot lowers it sarm until the arm bumps onto the Bumper Sensor.
14_SetMotor_ Turn clawMotor On at 50% power. Starts opening the robot claw.
15_Wait_ Stops the program from processing additional commands until 2 seconds have passed. Robot ensures that the claw is opened by keeping its motor on for 2 seconds.
_Comment_ Block used for human (you!) to make notes on your code. Program flow simply moves to the next block immediately. Block marks that the block sequence below it will perform Automatic Pickup action. Robot performs no action while on this block.
17_SetMultipleMotors_ Turns rightMotor and leftMotor On at 50% power. Starts moving the robot forward, towards the objects. StopMultipleMotors block will need to stop the robot later.
18_WaitUntil3_ Stops the program from processing additional commands until the Distance Sensor value is less than '65'. Robot waits until the object is less than 65 mm away.
19_StopMultipleMotors_ Stops rightMotor and leftMotor. Stops the robot when the object is within reach.
20_MoveMotor_ Turn clawMotor On at 50% power for 1 seconds. Close the claw to grab the object.
21_MoveMotor_ Turn armMotor On at 50% power until it have turn 90 degrees. Raise the robot arm to pick up the object.