Skip to main content
Teacher Portal

Teacher Toolbox icon Teacher Toolbox - Facilitating the Sort the Red and Blue Disks Page

What the Teacher Will Do:

  • Instruct students that they will continue to work in their groups to follow the steps on this page.
  • Circle the classroom as students work through the steps on this page and answer any questions that arise.
  • Students will let you know when they are ready for their check in. Guidance for this check in is provided in a Teacher Toolbox at the bottom of this page.
  • Once all groups have finished testing their projects and have picked up and dropped off a red and blue disk using Optical Sensor, bring the groups together for a whole-class discussion. Guidance for this discussion is provided in a Teacher Toolbox at the bottom of this page.

Now that we have coded the arm to pick up and sort the red disk using the Optical Sensor, we will now code the arm to pick up and sort both the red disk and the blue disk using the Optical Sensor. Both disks will begin in the pick up location at the same time. Because of this, we need to consider how the z-axis will change while the project is being run:

  • The starting z-coordinate for Point 2 will now be higher, because the project is starting with two disks in the pick up location.
  • After the arm sorts the first colored disk, it will need to move further down along the z-axis to pick up the second disk, because the second disk will be further down in the pick up location.

To account for this change in the z-axis, you will create a variable. This variable will be used to change the z-coordinate of Point 2 each time the arm sorts a disk. 

In VEXcode V5, follow the steps in this video to create the zHeight variable and add a [Set variable] block to the project.

The [Set variable] block will be used to set the initial z-value for Point 2. It is set to '2' because that is the z-value height when two disks are in the pick up location.

Follow the steps in this video to add the zHeight variable into the z-value for Point 2 and add a [Change variable] block to the project.

The [Change variable] block will be used to change the z-value by -0.5 each time the arm sorts a disk. Each disk is about 0.5 inches tall, so the project will change the z-value of Point 2 by roughly one disk's height.

Follow the steps in this video to duplicate the blocks from the red drop off location for the blue drop off location. Enter the coordinates for Point 5 into the [Joint move] block. 

These blocks will code the arm to drop the disk into the blue drop off location.

Use your coordinates for Point 5, and not the ones shown in this image.

Place the red and blue disks into the pick up location (the order does not matter) and then download and run the project. Press the Brain's screen to trigger the arm's movement. The arm will pick up and sort the the first colored disk.

After the first disk has been sorted, press the Brain's screen again to trigger the arm's movement. The arm will then pick up and sort the second colored disk.

If your arm did not sort the red and blue disks, notify your teacher. 

Download and runSort two disks

Once you have finished coding the arm to pick up and sort the red and blue disks using the Optical Sensor, stop the project.

Stop the Project

Teacher Toolbox icon Teacher Toolbox - Troubleshooting

If groups are finding that the arm does not pick up and move the red and blue disks when they run their project, try the following troubleshooting techniques.

  1. Check the zHeight variable.
    1. The value of '2' provided in the steps above may not be the best fit for your Workcell. Change the [Set variable] value to account for a different starting z-value.
    2. Verify that students set the [Change variable] block for zHeight to -0.5. Students may have forgotten the negative value.

change zheight variable

  1. Check the VEXcode V5 project.
    1. Have students compare their project to the videos and images on this page and ensure the order of the blocks match. Make sure students are re-downloading their project each time they make a change and before they run the project.
  2. Check the mastering values.
    1. Instruct students to check that the mastering values they recorded in their engineering notebook during Seek match what is in the [Set mastering] block.
    2. If the problem still persists, have students follow the steps in Seek to rerecord their mastering values.
  3. Check the build. 
    1. There may be a mechanical issue with your Workcell. Instruct students to look at the Lab 8 build instructions first and verify that the additions to their Workcell match.
    2. Have students go back to the Lab 1 build instructions for a complete look at the build and check that all elements match. Even one small detail being wrong can affect the movement of the arm on the Workcell.

Extend Your Learning icon Extend Your Learning

If groups finish early, ask them to run their project again, but instead of sorting one red disk and one blue disk, ask students to place two disks of the same color in the pick up location.

Ask students to think about the following as they run their project with two disks of the same color in the pick up location:

  • Do you have to change the value of the [Set variable] block at the top of the project?
  • Is the z-value of the red/blue drop off location high enough to accommodate two disks?

Teacher Toolbox icon Teacher Toolbox - Discussion

After groups have coded the arm to pick up and drop off a red and blue disk, engage the class in a discussion about their experience coding and their observations.

  • Begin by asking groups to share with the rest of the class the project they used to code the arm and Optical Sensor. If time allows, ask groups to run their project to show the arm picking up and dropping off the red and blue disks.
  • Then ask groups to share any observations they had while creating and testing the project. Ask students questions such as: 
    • How was the Optical Sensor used in this project? The Optical Sensor was coded using the <Optical detects color> block with the [If then] block so the arm knew where to place each disk depending on the color detected by the sensor.
    • How did you use variables in this project? The zHeight variable was used to change the z-coordinate of Point 2 to account for multiple disks in the pick up location.
    • How does the 'Lab 7- Sort Disk' project compare to the 'Lab 8- Sort Colors' project? Students should explain that the Lab 8 project added the Optical Sensor and also removed the colored squares on the Brain's screen. The Lab 8 project also accounted for multiple disks in the pick up location.