VEX Push Back
Coding Tutorial

A complete guide to programming a competitive VEX robotโ€”from hardware setup through odometry, PID tuning, and precision distance-sensor resetsโ€”using real code from a ranked skills run.

Start Learning โ†’   Jump to Distance Resets

What You'll Learn

This tutorial walks through every layer of the Push Back robot's codebase, explaining why each decision was made alongside the code that implements it. By the end you'll understand:

Tech Stack

Tool / LibraryPurposeVersion
PROSReal-time operating system for V5 Brain3.x / 4.x
LemLibOdometry, PID movement, path following0.4.x
VEX V5 BrainMain compute unitโ€”
VEX V5 MotorsBlue gearset drivetrain + intakeโ€”
Distance SensorsWall-relative position correctionV5 gen2
Inertial Sensor (IMU)Heading trackingV5
Optical SensorBlock color detection (anti-jam / sorting)V5
GPS SensorGlobal position (backup / skills)V5

Repository Structure

Vex-Push-Back/
โ”œโ”€โ”€ include/
โ”‚   โ”œโ”€โ”€ robot.hpp          โ† global hardware declarations
โ”‚   โ”œโ”€โ”€ autons/autons.hpp  โ† auton function declarations
โ”‚   โ””โ”€โ”€ systems/
โ”‚       โ””โ”€โ”€ chassis.hpp    โ† custom Chassis class (distance resets live here)
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ main.cpp           โ† initialize(), autonomous(), opcontrol()
โ”‚   โ”œโ”€โ”€ robot.cpp          โ† hardware definitions & LemLib config
โ”‚   โ””โ”€โ”€ autons/
โ”‚       โ””โ”€โ”€ autons.cpp     โ† all auton routines (match + skills)
โ””โ”€โ”€ static/                โ† this website
๐Ÿ’ก
About this code. The code taught here is from an active competition robot targeting a top-10 world skills ranking in the 2025โ€“26 Push Back season. All decisionsโ€”sensor choices, PID gains, distance reset placementโ€”reflect real competition constraints and lessons learned.