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

Starting and downloading Python projects in VEXcode EXP is easy.


How to Start a Python Project

Screen_Shot_2022-02-09_at_1.46.54_PM.png

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

Screen_Shot_2022-02-09_at_1.26.50_PM.png

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

Screen_Shot_2022-02-09_at_1.27.58_PM.png

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

Note: Currently, only EXP electronics are compatible with Python projects.

Screen_Shot_2022-02-09_at_1.29.06_PM.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 EXP BaseBot forward for 200 millimeters (mm).

Screen_Shot_2022-02-09_at_1.29.48_PM.png

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

Screen_Shot_2022-02-09_at_1.30.51_PM.png

Select the Basebot (Drivetrain 2-motor) template. Templates are blank projects with preset device configurations.

Screen_Shot_2022-02-09_at_1.32.41_PM.png

If your project was not saved, the 'Save now' window will appear before the Example Project opens in the workspace.

Select 'Save' if you you want to save your previous project, otherwise select 'Discard.'

Screen_Shot_2022-02-09_at_1.35.13_PM.png

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

Screen_Shot_2022-02-09_at_1.36.32_PM.png

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

Screen_Shot_2022-02-09_at_2.08.33_PM.png

Now you can add commands from the Toolbox. Select the Drive for command.

Screen_Shot_2022-02-09_at_2.09.15_PM.png

Drag the Drive for command into the workspace and place it on the last line of the project (line 43).


How to Download and Run a Python Project

Screen_Shot_2022-02-09_at_1.40.05_PM.png

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

Screen_Shot_2022-02-09_at_1.40.55_PM.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.

Screen_Shot_2022-02-09_at_1.42.09_PM.png

Next, connect the Brain to your device (Directly via Micro-USB, USB-C or via VEX Controller. View this section of the Knowledge Base to learn more about connecting an EXP Brain to VEXcode EXP) and check that the Brain icon is green.

Screen_Shot_2022-02-09_at_1.42.42_PM.png

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

Screen_Shot_2022-02-09_at_1.43.07_PM.png

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

Driveforward.png

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

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

Last Updated: