No experience needed. By the end of this guide you will have a PROS project open, a program running on the robot, and your first autonomous line of code working. One task at a time.
Each section has one task with a time estimate. Read the explanation, then do the task on your actual laptop with your actual robot. Do not skip the task and just read — the doing is what makes it stick.
If something goes wrong, that is fine and expected. Read the error message, look for the callout boxes marked with a warning icon, and ask your coach if you are stuck for more than a few minutes. Getting unstuck quickly is a skill the whole team builds together.
Launch VS Code from the Start Menu or your taskbar. If it opens to a blank screen, that is fine — you just need to open your project folder.
Go to File → Open Folder (or press Ctrl+K then Ctrl+O). Navigate to your EZ Template project folder and click Select Folder. VS Code will reload and show the project files in the left sidebar.
Look at the left sidebar for the PROS icon (a blue circle with a P). If it is there, PROS loaded successfully. If not, open the Extensions panel and make sure PROS is installed and enabled.
Your EZ Template project contains a lot of files. Most of them are the PROS kernel and EZ Template library — you will never touch them. The files you will edit are highlighted below.
EZ-Template/ or firmware/, leave it alone. Everything you need to write is in src/ and include/. VS Code's file explorer makes this easy to see.In the VS Code sidebar, click src to expand it, then click main.cpp to open it. It will appear in the main editor area. Leave it open — the next section walks through exactly what each part does.
main and press Enter to jump to main.cpp from anywhere. This saves a lot of clicking as your project grows.The port numbers and wheel diameter are the first things you will customize for your specific robot. For now, just notice the pattern: left ports, right ports, IMU port, wheel size, motor speed.
Think of initialize() as the robot's boot sequence — it runs before any match period. The chassis must be initialized here or nothing else works. The auton selector registration is also here so routes are available before a match starts.
pros::delay() from opcontrol. Without it, the loop runs thousands of times per second, starves other PROS tasks of CPU time, and can cause unpredictable behavior. The 20ms delay is standard — leave it in every loop you write.Your autonomous routines live in autons.cpp, not here. This function just tells EZ Template to run whichever one was selected. You registered your routines in initialize() — when autonomous starts, this one line runs them.
pros::delay(ez::msec2) required inside the opcontrol while loop?In main.cpp, inside initialize(), look for a line that sets the drive speed. It will look something like this:
If your project does not have this line yet, add it inside initialize() right after chassis.initialize(). The number 127 is PROS's maximum motor voltage — it maps to 100% speed.
Change 127 to 60. This limits driver control to about 47% speed — slow enough to clearly notice the difference, fast enough to still drive properly.
Open the VS Code terminal with Ctrl+` (backtick, top-left of keyboard). Type the following and press Enter:
Watch the terminal output. You will see lines like Compiling main.cpp then Uploading.... When it finishes with done, the new program is on the Brain.
pros build-upload again. Do not try to fix multiple errors at once.Run the program on the Brain (either from the Brain screen or by pressing run). Try driving with the controller. The robot should feel noticeably slower than before.
Once confirmed, change the value back to 127 for full speed and upload again. You have just completed your first change-build-test cycle — this is what programming feels like.
200 instead of 127. What do you expect to happen? Upload and test. What actually happens? Why? (Hint: the V5 motor voltage is capped by hardware — the Brain will not let you exceed the safe maximum.)The controller rumble should happen once when opcontrol starts — not inside the while(true) loop. If you put it inside the loop, it will try to rumble 50 times per second, which will not work correctly.
Add the new line before the while(true), like this:
"." = short buzz, "-" = long buzz, " " = pause. Try ".-." for a long buzz between two short ones. The controller hardware limits the length.Let us break down master.rumble("."); into its parts:
This pattern — object.function(argument); — is the most common structure in all of your robot code. chassis.drive_distance(24) is the same pattern. arm.move(127) is the same pattern. Once you recognize it, reading new code becomes much easier.
Run pros build-upload in the terminal. When driver control starts (either from the Brain screen or competition switch), you should feel the controller buzz once. If it does not buzz, check that your controller is paired to the Brain.
pros::delay(90000) (90 seconds) after your loop starts, then another master.rumble("-") after the delay. This simulates a "match end" warning buzz. Where in the code would this go? How would it behave differently if you put it inside vs outside the while loop?In the VS Code sidebar, expand src/ and open autons.cpp. You will see the existing autonomous functions — they may be empty placeholders or have some example code depending on which EZ Template version you downloaded.
Add this function at the bottom of autons.cpp, after all the existing code:
drive_distance(24) is a blocking function — it will not return until the robot has traveled 24 inches (or timed out trying). EZ Template's PID controller handles the motor corrections automatically. You just tell it where to go.
Open include/globals.hpp. Find the section where other autonomous functions are declared — it will look something like this:
This declaration tells the compiler that DriveTest() exists — even though it is defined in a different file. Without this line, main.cpp will not be able to call it and you will get a compile error.
Open main.cpp. Inside initialize(), add your routine to the autons_add list:
The first part is the display name on the Brain screen. The second part is the function name — no parentheses, just the name itself.
Run pros build-upload in the terminal. Fix any errors that appear before moving on.
On the Brain screen, navigate to your program and run it. The auton selector should show "Drive Test — 24 inches". If it does not appear, check that autons_add is inside initialize() and re-upload.
From the Brain's program screen, select the program and run autonomous mode. The robot should drive forward 24 inches and stop. If you have a competition switch, use it to test the full disabled → autonomous sequence.
main.cpp, find your chassis port list, and add a minus sign (-) before the port numbers for motors that are spinning backward. This is normal on the first setup of any robot.pros::Motor arm = 12000; because the types do not match. This is called static type checking.