Skip to main content

Lesson 2: Using the Electromagnet

Building the Project

  • The first blue disk is 750 millimeters (mm) away from the starting point of the VR Robot on the Disk Mover Playground. Drag in a drive_for command beneath the first comment and set the parameters to drive forward 750 millimeters (mm).
    drive forward 750 mm

For Your Information

The distance between the starting point of the VR Robot and the first blue disk was estimated using the dimensions of each grid square. Each grid square on the Disk Mover Playground is 200 millimeters (mm) by 200 millimeters (mm).

Each grid square is 200mm by 200mm.

Using this information, it can be estimated that the first blue disk is 800 millimeters (mm) from the center of the VR Robot. Since the Electromagnet is on the front of the VR Robot, the distance between the Electromagnet and the first blue disk may be slightly shorter than the 800 millimeters (mm).

VEXcode VR robot

  • Once the VR Robot reaches the first blue disk, the VR Robot must boost the Electromagnet using the energize command. Drag or type the energize command beneath the second comment.

    set electromagnet to boost

  • Next, the VR Robot will drive in reverse back to the starting point with the blue disk. Drag or type a drive_for command beneath the third comment. Set the drive_for command parameters to reverse 750 millimeters (mm).
    drive reverse for 750 mm
  • Once inside the blue goal, the VR Robot will need to release the blue disk. Drag or type an energize command beneath the fourth comment, and set the parameter to ‘DROP.’
    set parameter in electromagnet energize command to drop
  • Open the Playground Window if it is not already open. Be sure the Disk Mover Playground opens, and run the project.

    Open the Disk Mover Playground.

  • The VR Robot picks up the first blue disk by energizing the Electromagnet, then drives in reverse back to the blue goal and drops the blue disk.

    The VR Robot picks up the first blue disk.

Select the Next button to continue with the rest of this Lesson.