Setup Guide
Install VS Code and the VEX Robotics extension, then open the VEXLearn project.
Follow along in the course setup lab to check your progress as you install the tools.
Installing VS Code
- Open the Visual Studio Code download page and choose Download for Windows.
- Open the downloaded installer file
- Accept the license agreement and click Next
- On the "Select Additional Tasks" screen, make sure Add to PATH is checked (the rest is optional)
- Click Install and wait for it to complete
You can also use other editors like Antigravity, but VS Code is the most widely tested with the VEX extension.
Installing the VEX VS Code Extension
The VEX Robotics extension adds support for building and downloading VEX programs directly from VS Code.
- Open Visual Studio Code
- Click the Extensions icon in the left sidebar (or press
Ctrl+Shift+X)
- In the search bar, type
vex
- Find VEX Robotics (by VEX Robotics) in the results and click Install
- Wait for the extension to finish installing
PROS is not supported. VEXLearn only works with the official VEX VS Code extension and V5 platform (not IQ or EXP).
Installing the Template
Prerequisites
- You have VS Code (or another editor) installed
- You have the VEX Robotics extension installed
- Download the VEXLearn Template ZIP
- Extract the ZIP file to a location on your computer
-
Open VS Code, go to File → Open Folder, and open the extracted folder.
The folder you open must be named
VEXLearn Template. When you extract the ZIP, a parent folder may be created withVEXLearn Templateinside it. Open the inner folder. If you open the outer parent folder, the VEX extension will not recognize the template. -
Let VS Code install the required dependencies automatically.
If a popup asks "Do you want to install Microsoft's Makefile tools?", click No. Installing it will break the template.
Choose your setup
Follow the section for how you plan to use the template.
For learning without a robot
If you just want to explore how the code works and learn from it, no extra setup is needed beyond installing the template. You're done!
Browse the source files to understand how the template is structured:
src/main.cpp: Entry point, thread setup, pre-auton calibrationsrc/drive.cpp: Driver control and button mappingssrc/movement.cpp: PID-based move and turn functionssrc/auto.cpp: Autonomous functionssrc/display.cpp: Brain and controller screen renderingsrc/robotConfig.cpp: Motor, sensor, and piston objects
For use on a robot
Your robot must meet these hardware requirements:
- Tank-drive chassis (no X-drive, H-drive, or mecanum)
- All chassis wheels must be the same size
- Clear split between left and right chassis motor groups
- Omni wheels and traction wheels are both fine
- Must have an inertial sensor
- Only V5 motors (not EXP or IQ)
- Only one controller
Robot Setup Checklist
Click each step to mark it complete as you go:
-
Go to
vex.hand changewheel_2rto your wheel diameter -
In
robotConfig.cpp: add/remove motors with correct gear ratio, port, and direction -
In
robotConfig.cpp: add/remove sensors with correct port number -
In
robotConfig.cpp: add/remove pistons with correct three-wire port -
In
robotConfig.cpp: update motor groups so motor names match -
In
robotConfig.h: declare the same objects defined in robotConfig.cpp usingextern -
In
movement.cpp: update the gear ratio in the move function (default is 4/3) -
In
drive.cpp: delete examples, write your button mappings -
In
main.cpp: update pre_auton to calibrate your sensors -
In
display.cpp: remove motors that don't exist, update team name/number - Compile the project and confirm that it has no errors (warnings are acceptable)
- Run on the robot and verify it works. Adjust driver preferences (deadband, sensitivity)
-
In
auto.cpp: write a simple PID test function (e.g.move(100, 0, 8);) and tune PID -
In
auto.h: declare your PID tuning function. Robot is ready!
When you're done with setup, start tuning PID for move() and turn() in movement.cpp. See the VEX Concepts → PID section for tuning guidance.
Practice: Find the project folder
Worked example. If VS Code shows just one folder called VEXLearn Template in Explorer, open it and check for src, include, and makefile. Open the folder that contains those items.
Your turn. The ZIP extracted to Downloads/VEXLearn Release/VEXLearn Template. Which folder do you select in File → Open Folder?
Reveal the answer
Open the inner VEXLearn Template folder. It is the project root because it contains makefile, src, and include.