Starting, Downloading, and Running a Python Project in VEXcode V5

Starting and downloading Python projects in VEXcode V5 is easy.


How to Start a Python Project

Launch VEXcode V5

Launch VEXcode V5. The platform defaults to the Blocks interface.

File new text project

Select ‘File,’ then ‘New Text Project’ to open the text interface.

2020-11-24_9-58-46a.jpg

Next, select the Python project language. There is the option to start a new project in either C++ or Python.

Python_interface.png

The Python interface will open.


How to Build a Python Project

This section will show you how to create a basic Python project using commands from the Tool Box. The project outlined here will drive the V5 Clawbot forward for 200 millimeters (mm).

Python_file_open_examples.png

Select ‘File’ then ‘Open Examples” to open a template project.

Clawbot__Drivetrain__2-motor__No_Gyro_.png

Select the Clawbot (Drivetrain 2-motor, No Gyro) template. Templates are blank projects with preset device configurations.

Add_comments.png

Notice that a set of project comments open in the workspace. You will add commands after the comments.

To learn more about comments, see the Using Comments in VEXcode V5 Python article here.

Add_code_new_line.png

Select enter at the end of the last line of code (line 14). This should create the next numbered line (line 15). This is where you will start adding code to the project.

Drive_For_command.png

Now you can add commands from the Tool Box. Select the drive_for command.

add_drive_for.png

Drag the drive_for command into the workspace and place it on the last line of the project (line 15).


How to Download and Run a Python Project

Drive_Forward_name.png

First, name and save your Python project. View one of the following articles for detailed information on how to save a VEXcode V5 Python project:

Slot_1.png

Then, choose which of the Brain’s slots you will download the project to. To do this, select the ‘Slot’ button on the Toolbar.

Green_brian_icon.png

Next, connect the Brain to your device (Directly via Micro-USB or via VEX Controller) and check that the Brain icon is green.

Download_icon.png

Select the ‘Download’ button to download the project to the Brain. The project will download to the chosen slot.

Run_icon.png

Finally, select ‘Run’ to start the project while the robot is still connected to your computer.

Drive_FOrward_Brain.png

Or, disconnect the Brain from your device and run the project on the V5 Brain.

For more information, help, and tips, check out the many resources at VEX Professional Development Plus

Last Updated: