In this Play section, you will be introduced to the V5 Optical Sensor on the Workcell. You will create a project where the arm uses the electromagnet to pick up two colored disks (red and blue), use the Optical Sensor to determine their color, and drop each disk in their drop off location, based on the color detected by the sensor. The red and blue drop off locations are shown in this image.
You will display the (x, y, z) coordinates on the V5 Brain’s screen to find the locations that the arm will need to move to in order to pick up two colored disks, place the disks over the Optical Sensor, and then drop off the disks. You will then use these locations to explore how to trigger behaviors of the arm by building a project that uses the {When brain screen pressed} hat block.
You will complete the activity by successfully picking up one red disk and one blue disk, determining their color based on the Optical Sensor, and then dropping them off in their respective drop off locations.
Quantity | Materials Needed |
---|---|
1 per group |
V5 Workcell |
1 per group | |
1 per group |
Engineering Notebook |
1 per group |
Device to run VEXcode V5 |
1 per group |
Micro-USB cable |
2 per group |
Colored Disks (1x red, 1x blue) |
In order to code the arm to sort two colored disks using the Optical Sensor, you first need to build the 'Lab 8- Manual Move' project.
In VEXcode V5, follow the steps in this video to open the 'Arm Manual Movement' example project, input your mastering values, adjust the tool to electromagnet, name, and then save the project as 'Lab 8- Manual Move.'
Ensure you are using your mastering values, and not the ones displayed in this video.
Download and run the project. (x, y, z) values will be displayed on the Brain's screen.
Place a red colored disk into the disk pick up location and then manually move the arm to Point 1. Point 1 is directly above the disk pick up location. Record the (x, y, z) coordinates of Point 1 in your engineering notebook.
For Your Information
The x and y-coordinate values of Point 1 and Point 2 will be very similar, if not the same. Because the arm should only move down to contact a disk between Point 1 and Point 2, the z-axis is the only axis that is significantly changing.
Manually move the arm to Point 2. Point 2 is where the electromagnet comes in contact with the red disk. Record the (x, y, z) coordinates of Point 2 in your engineering notebook.
Manually move the arm to Point 3. Point 3 is where the disk is just above the Optical Sensor. Record the (x, y, z) coordinates of Point 3 in your engineering notebook.
Manually move the arm to Point 4. Point 4 is where the disk is just above the standoffs of the red drop off location. Record the (x, y, z) coordinates of Point 4 in your engineering notebook.
Place the red disk in the red drop off location and put a blue disk on the electromagnet. Then, manually move the arm to Point 5. Point 5 is where the blue disk is just above the standoffs of the blue drop off location. Record the (x, y, z) coordinates of Point 5 in your engineering notebook.
Once you have finished recording all five points, stop the project and check in with your teacher.