Skip to main content

Lesson 2: Plan the Project

In this Lesson, you will learn how to use the energize command to pick up and drop disks on the Disk Mover Playground. You will use the energize command with Drivetrain commands to pick up and move three blue disks into the blue goal in the mini challenge.

Learning Outcomes

  • Describe how comments can be used to plan and organize a VEXcode VR Python project.
  • Describe the program flow in a project that has the VR Robot use the Electromagnet to pick up, carry, then drop a disk.

Planning a Project with the Electromagnet

To begin the Disk Mover challenge, the VR Robot will pick up and move the first blue disk into the blue goal. In order to do this, the VR Robot will complete four behaviors, using the Electromagnet and the Drivetrain commands. It is useful to plan the behaviors needed to complete a project prior to beginning to build your code, so that you can ensure that you have a conceptual understanding of the goal of the coding project. The goal of moving the first blue disk can be broken down as follows:

  • First, the VR Robot will drive forward to the first blue disk.

    ZDrive forward to the first blue disk.

  • Second, the VR Robot will use the Electromagnet to pick up the first blue disk.

    Pick up the first blue disk.

  • Third, the VR Robot will drive in reverse back to the blue goal.

    Drive in reverse to the starting position.

  • Lastly, the VR Robot will use the Electromagnet to drop the blue disk into the blue goal.

    Drop the blue disk into the blue goal.

Now that the behaviors in the project have been identified, those behaviors can be used to create comments in the project.

Using Comments for Project Planning

You can use comments in a VEXcode VR Python project to help plan the behaviors of the VR Robot, by organizing them into smaller sections within the project. While building the project, the commands associated with each desired behavior are placed beneath the matching comment.

  • Start a new project and select the Disk Mover Playground when prompted. Image of the Disk Mover Playground selection tile
  • Name the project Unit8Lesson2.Unit8lesson2

     

  • Type 4 comments into the workspace. Comments in Python start with the # (pound) sign. Add comments for each of the steps outlined above.
    comments to stub out program

With comments in place, we can begin building our project one command at a time.  

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