VEXLearn Foundations

Pilot course, 8 modules, about 10 to 14 hours

Start with basic C++ in the VEXLearn template. Then configure the motors, change how the controller drives the robot, and write an autonomous routine. The last modules cover PID tuning and testing the same route across repeated runs.

A school club can aim for one module per meeting. Allow extra meetings for Modules 5 through 7 if you are tuning or testing on a robot.

Intended Audience

Choose a course path

Code learning path

Use a computer to read, modify, and explain the template. Complete Modules 0 through 4, the code-reading versions of Modules 5 through 7, and a written capstone design.

Robot programming path

Build and test the capstone on a tank-drive VEX V5 robot. You need separate left and right motor groups, a V5 inertial sensor, the official VEX extension for VS Code, and a safe testing area.

Course Progress

Mark each module complete as you work. Progress is stored only in this browser on this device.

0 / 8 done

Module 0: Orientation and Baseline

30 to 60 minutes. Both pathways.

Choose a pathway, install your tools, and locate the files you will use throughout the course.

Follow-along setup lab

Check each step when it matches what you see on your computer. Progress is saved in this browser.

0 / 4 done
  1. 1. Install VS Code

    Get the VS Code installer for your operating system. Install it and open VS Code.

    Visual Studio Code download page showing the Windows download button
  2. 2. Add the VEX extension

    Open Extensions in VS Code. Search for VEX Robotics and install the extension published by VEX Robotics.

    The official VEX Robotics extension in VS Code search results
  3. 3. Open the project

    Download and extract the Template ZIP. In VS Code, choose File → Open Folder and select the inner VEXLearn Template folder containing makefile.

    VEXLearn Template/
      include/
      src/
      vex/
      makefile
  4. 4. Find the starting file

    Open src/main.cpp in the Explorer. Look for main() and the call to pre_auton(), which prepares the robot before the match.

    src/
      main.cpp
      robotConfig.cpp
      drive.cpp
      movement.cpp
      auto.cpp
      display.cpp

Working with a robot? Open the robot setup checklist and return here for the baseline activity.

Required Reading

Activities

  1. Complete the pre-course assessment.
  2. Write one sentence describing the purpose of each of the six source files shown in the setup lab.

Evidence and Checkpoint

Submit a completed setup checklist, baseline score, six-file project map, and selected pathway. Pass by correctly matching at least five of the six major source files with their purpose.

Download pre-course assessment

Continue to Module 1: C++

Module 1: C++ Fundamentals for VEX

90 minutes. Both pathways.

Identify common data types, declare and update variables, use operators, read control structures, explain function signatures, and distinguish declarations from definitions.

Required Reading

Data Types, Variables, Operators, Loops and If-Statements, Functions, Header Files, File Integration, and Namespaces.

Activity 1: Predict the Result

Predict the final value before running or checking this code:

int speed = 5;
speed += 2;

if (speed > 6) {
    speed = 6;
}
Check your prediction

speed ends at 6. Adding 2 makes it 7, so the condition is true and the assignment sets it to 6.

Activity 2: Repair the Code

Correct at least five errors involving missing semicolons, incorrect variable types, assignment versus comparison, misspelled function names, and missing header declarations.

Activity 3: Write a Function

double limitVoltage(double requestedVoltage, double maximumVoltage);

The function must return a value that does not exceed the positive or negative maximum.

Evidence and Checkpoint

Submit the corrected exercise, completed function, a short explanation of declaration versus definition, and the module quiz. Score at least 75% on the quiz.

Download debugging exercise

Module 2: Understanding the VEXLearn Project

60 to 90 minutes. Both pathways.

Trace functions across source and header files, explain the role of main.cpp, connect VEX objects to physical hardware, and identify Smart Ports and three-wire ports.

Required Reading

Program Structure, Header Files, Object-Oriented Programming and VEX Objects, How Ports Work, Connecting to the Brain, and Downloading Software.

Activity 1: Trace a Function

Trace move() from movement.h to movement.cpp and then to a call in auto.cpp. Identify where it is declared, defined, and called, and explain each argument.

Activity 2: Hardware Map

HardwareSoftware objectPortReversed?Purpose
Left front motorLeftMotor11YesChassis
Inertial sensorInertial9N/AHeading

Students without a robot use the default template configuration.

Activity 3: Explain an Object

Explain why Inertial.heading(); uses both an object and a function.

Evidence and Checkpoint

Submit the function-tracing worksheet, hardware/software map, and annotated project diagram. Correctly explain the relationship among robotConfig.cpp, robotConfig.h, and the other source files.

Download project map

Module 3: Robot Configuration and Driver Control

90 minutes. Both pathways.

Configure motors and sensors, modify motor groups and driver behavior, change controller mappings, and use a Boolean variable to toggle a mechanism.

Required Reading

Robot Setup Checklist, How Ports Work, Gear Ratio and Software, 6-Watt versus 12-Watt Motors, robotConfig.cpp, and drive.cpp.

Activity 1: Configure the Robot

Hardware-path students update motor ports, directions, groups, sensor and piston ports, wheel diameter, and external gear ratio. Code-learning students create a hypothetical six-motor tank-drive configuration.

Activity 2: Change Driver Preferences

Modify at least two of the following: deadband, controller sensitivity, coast-to-brake timing, button mapping, or mechanism speed.

Activity 3: Add a Mechanism Toggle

Implement or modify a Boolean-based controller toggle for a piston or another mechanism.

Evidence and Checkpoint

Submit a configuration commit or saved code copy, explain two modifications, and record the compilation result and hardware demonstration when available. The program must compile, or the student must correctly identify and explain the remaining compilation problem.

Download configuration planner

Module 4: Autonomous Movement

90 minutes. Both pathways.

Explain auto.cpp, use move() and turn(), understand their arguments, plan routes, and recognize when an advanced odometry-based template is more appropriate.

Required Reading

Absolute Heading, Voltage versus RPM Control, Writing Autonomous Functions, movement.cpp, and auto.cpp.

Activity 1: Read Movement Calls

move(100, 0, 8);
turn(90, 6);
move(50, 90, 6);

Explain the expected behavior of each line, including distance, heading, and voltage.

Check your route reading

The first call moves 100 cm while holding 0° with an 8 V limit. The turn targets 90° with a 6 V limit. The last call moves 50 cm while holding 90° with a 6 V limit.

Activity 2: Plan a Route

Draw a route with a starting position, distances, headings, mechanism actions, and expected ending position.

Activity 3: Write a Three-Step Routine

Include at least one move(), at least one turn(), and at least one additional movement or mechanism action.

Evidence and Checkpoint

Submit the route diagram, autonomous source code, and an explanation of every movement argument, followed by a code review or physical demonstration. Explain what the robot should do without running the program.

Download route planner

Module 5: PID Tuning Laboratory

2 to 3 hours. Hardware testing recommended.

Explain proportional, integral, and derivative control; identify windup, overshoot, oscillation, and steady-state error; and select tuning values using controlled evidence.

Required Reading

PID Controller, Integral Windup, Interactive PID Demo, Voltage versus RPM Control, and the PID sections in movement.cpp.

Laboratory Rules

  • Use the same starting position, target distance, and maximum voltage.
  • Change only one PID value at a time.
  • Record battery percentage for every trial.
  • Use a physical starting aligner and record trials on video when possible.

Activities

  1. Adjust Kp and record response speed, overshoot, final error, and oscillation.
  2. Adjust Kd and observe changes in oscillation and overshoot.
  3. Explain integral accumulation, voltage saturation, and why accumulated error resets after crossing the target.
  4. Justify final constants using at least three recorded trials.

Required Trial Data

TrialKpKiKdTargetFinal errorOvershootOscillationBatteryNotes
1
2

Evidence and Checkpoint

Submit at least eight documented trials, final constants, a before-and-after comparison, and a paragraph explaining the decision. Each team defines its tolerance before testing. A suggested standard is at least eight of ten trials within that distance or heading tolerance.

Download PID laboratory log

Module 6: Reliability, Debugging, and Testing

90 minutes. Hardware testing recommended.

Separate software from hardware failures, use repeated trials, record failure conditions, evaluate environmental factors, and revise code using testing evidence.

Required Reading

Writing Autonomous Functions and the stopping and timeout behavior in movement.cpp.

Activities

  1. Classify failures as configuration, compilation, control logic, sensor, mechanical, starting-position, battery or power, or unknown.
  2. Run the same autonomous routine ten times and record success, ending error, battery, failure category, and notes.
  3. Identify the most frequent failure, make one change, and complete five more trials.

Evidence and Checkpoint

Submit the ten-run baseline, one documented revision, five-run retest, before-and-after success rate, and a short failure analysis. Explain why one successful run does not prove an autonomous routine is reliable.

Download reliability log

Module 7: Final Autonomous Capstone

2 to 4 hours. Final project.

Design, program, test, and explain a short autonomous routine using the VEXLearn template.

Minimum Requirements

  • At least three movement commands and one turn
  • At least one mechanism action when hardware permits
  • A planned starting position and route diagram
  • A safe timeout or bounded movement behavior
  • At least ten documented physical trials for the Robot Programming Path

The Code Learning Path submits the complete route, code, predicted behavior, and testing plan without physical trial results.

Required Submission

  1. Route diagram
  2. Source code
  3. Hardware configuration
  4. PID values
  5. Trial log
  6. Short demonstration video
  7. Failure analysis
  8. Final reflection

Reflection Questions

  • What part of the routine was least reliable?
  • Which change produced the largest improvement?
  • What evidence supports your final PID values?
  • What hardware behavior affected the software?
  • What would you change with another week?
  • When would a more advanced framework such as JAR Template or LemLib become appropriate?
Download capstone rubric

Capstone Rubric

CategoryPoints
Correct project and hardware configuration15
Understanding of C++ and project structure15
Driver-control or mechanism modification10
Autonomous planning and implementation20
PID tuning process15
Reliability testing and evidence15
Explanation, documentation, and reflection10
Total100

Performance Levels

Pre-Course and Post-Course Assessment

Use the same concepts before and after the curriculum, but change numerical values and code examples so the post-test does not reward memorizing answers.

  1. What is the difference between int, double, and bool?
  2. What does == mean, and how is it different from =?
  3. What does a while loop do?
  4. What is the purpose of a header file?
  5. Where are VEX motors and sensors configured?
  6. What does the heading argument in move() control?
  7. Why must the software gear ratio match the physical drivetrain?
  8. What does the proportional term of PID respond to?
  9. What is integral windup?
  10. Why should an autonomous routine be tested multiple times?
  11. Name two non-software factors that can change autonomous performance.
  12. When should a team consider moving from VEXLearn to an odometry-based template?

Questions 1-6 are worth one point each. Questions 7-12 are worth two points each, for 18 points total. Record initial and final scores, percentage-point improvement, module completion, capstone score, autonomous trial success rate, and student confidence before and after.

Download post-course assessment

Instructor Guidance

VEXLearn is designed to help students understand beginner VEX V5 software. Instructors should ask students to explain code before copying or modifying it. Physical movement activities must be conducted in a clear testing area with the robot raised or restrained during initial mechanism tests.

The curriculum prioritizes understanding, testing, and documentation over achieving one universal performance threshold. Different robots require different PID values and tolerances.

Download instructor guide

What to record during the pilot

Record how many students start and finish, how assessment scores change, and how many complete the capstone. Note where students get stuck and what you change in response.