You already know how to program with VEXcode blocks. This guide shows you that text coding is just the same thing — written differently.
1
Intro
2
The Editor
3
Blocks → Text
4
Key Concepts
5
Cheatsheet
// Section 01
You Already Know How to Code 🎉
Seriously. Text coding isn't a different skill — it's just a different way of writing the same ideas.
When you use VEXcode Blocks, you drag colorful puzzle pieces that tell the robot what to do. When you use text coding, you type those same instructions instead of dragging them.
That's really it. The logic is identical. The only difference is that instead of dragging a block, you type a line.
🗣️
Think of it like texting vs. talking
If you say "turn the lights on," that's like a block. If you text "turn the lights on," that's like typed code. Same instruction. Different format. The house still lights up either way.
Why bother with text code at all?
⚡
Way Faster to Write
Typing motor.spin() takes 2 seconds. Scrolling through a block menu, finding the right one, and dragging it takes way longer.
🔓
No Limits
Blocks only let you do what VEX built blocks for. Text code lets you do anything — custom math, complex logic, features nobody made a block for yet.
🌍
Real-World Skill
Every professional programmer uses text. Learning it now means you already know how to code like a real software engineer.
🏆
Competitive Edge
The best V5RC teams at Worlds use PROS text coding. Better code = more consistent autonomous = more points.
🎮
Fun fact: The C++ language you'll use is the same language used to write video games, operating systems, and even parts of the software that runs on actual NASA spacecraft.
1 of 5
// Section 02
Meet VS Code — Your New Coding Home 🖥️
VS Code is a text editor. It's where you'll type your robot's code.
📝
VS Code is like Google Docs... for code
Just like Google Docs is where you write essays, VS Code is where you write programs. It saves your file, shows you errors (like spell-check), and helps you organize everything.
All your robot's files listed here. Click any file to open it and edit it.
📝
Code Editor (Middle)
The big area where you type your code. Colors help you see keywords, numbers, and comments.
💻
Terminal (Bottom)
A command line you type into. Used to build and upload code to your robot.
Your 3 Most Important Keyboard Shortcuts
⌨️
Ctrl + S — Save your file. Do this constantly. Unsaved code won't upload!
Ctrl + Z — Undo. Made a mistake? Hit this to go back.
Ctrl + / — Comment out a line. Turns code into a note so it doesn't run (useful for testing!).
⚠️
Save before you upload! VS Code has auto-save but it's not always on. Get in the habit of hitting Ctrl+S every time you finish typing something.
2 of 5
// Section 03
Same Idea, Different Look 🧩➡️📝
Every block you know has an exact text equivalent. Let's see them side by side.
💡
For each example below, the purple block side is what you'd do in VEXcode Blocks. The blue code side is the same thing in PROS C++.
1. Spin a Motor Forward
🧩 VEXcode Block
spin Motor1 forward at 100%
📝 PROS C++ Text
motor1.move_voltage(12000);
12000 = full speed forward (100%)
2. Wait / Delay
🧩 VEXcode Block
wait 1000 msec
📝 PROS C++ Text
pros::delay(1000);
1000 milliseconds = 1 second
3. If / Else (Button Check)
🧩 VEXcode Block
if Button A pressed
spin intake forward
else
stop intake
📝 PROS C++ Text
if (controller.get_digital(DIGITAL_A)) {
intake.move_voltage(12000);
} else {
intake.brake();
}
4. Repeat Forever (Driver Control Loop)
🧩 VEXcode Block
forever loop
drive arcade style
wait 20 msec
📝 PROS C++ Text
while (true) {
chassis.opcontrol_tank();
pros::delay(20);
}
while(true) = "do this forever"
✅
Notice the pattern? The text code always ends with a semicolon (;) at the end of each instruction — just like a period at the end of a sentence. Curly braces { } group things together, just like how blocks indent inside a loop or if-statement.
Quick Check ✏️
In C++, what does while(true) { ... } do?
⬜ Runs the code inside exactly once
⬜ Repeats the code inside forever
⬜ Waits for a button press
⬜ Stops the robot
3 of 5
// Section 04
5 Things That Confuse Beginners 🤔
These are the parts of text coding that trip people up at first. Once you get these, everything clicks.
1. Semicolons — The Period of Code
✏️
Every instruction ends with a semicolon
In English, every sentence ends with a period. In C++, every instruction ends with a semicolon ( ; ). If you forget it, the computer gets confused — like reading a run-on sentence that never ends.
Curly braces are like a box that holds instructions
When you indent blocks inside a loop in VEXcode, curly braces do the same thing in text. Everything between { and } belongs to that loop or function.
while (true) { ← opening brace — "start the box"
chassis.opcontrol_tank();
pros::delay(20);
} ← closing brace — "end the box"
⚠️
Always match your braces! Every { needs a closing }. VS Code will highlight mismatched braces in red to help you spot them.
3. Comments — Notes Just for You
💬
Comments are notes the computer ignores
Start a line with // and the computer skips it entirely. It's a note for you (or your teammates) explaining what the code does. Use them constantly — future you will thank present you.
// This runs when the driver controls the robotvoidopcontrol() {
while (true) {
// Tank drive: left stick = left wheels, right stick = right wheels
chassis.opcontrol_tank();
pros::delay(20); // always delay to prevent CPU overload
}
}
4. Variables — Storing Values
🗄️
A variable is a labeled box that stores a value
You might have used "set variable X to 5" in block coding. In C++, you do the exact same thing — just written differently. int means "whole number", double means "decimal number".
int speed = 200; // whole number variabledouble turnAmount = 90.5; // decimal number variablebool intakeOn = false; // true/false variable// Use them like this:
motor.move_velocity(speed);
5. Functions — Reusable Blocks of Code
🔧
A function is like naming a group of blocks
In VEXcode you might have a "My Block" that groups several steps together. In C++, that's called a function. You write it once, then call it by name whenever you need it.
// Define the function once:voidscoreRing() {
intake.move_voltage(12000); // spin intake
pros::delay(500); // wait half a second
intake.brake(); // stop intake
}
// Call it anywhere — easy!scoreRing();
scoreRing(); // call it again!
Quick Check ✏️
You write // drive forward in your code. What happens when the robot runs?
⬜ The robot drives forward
⬜ Nothing — it's a comment, the computer ignores it
⬜ The code crashes
4 of 5
// Section 05
Your Quick Reference Cheatsheet 📋
Bookmark this page! These are the most common things you'll type when coding your V5 robot.
Syntax Basics
What to type
What it means
Example
;
End of an instruction (like a period)
motor.brake();
{ }
Group of instructions (like indented blocks)
while(true) { ... }
//
Comment — computer ignores this line
// spin the intake
( )
Pass a value into a command
delay(1000)
int
Store a whole number
int speed = 200;
bool
Store true or false
bool on = true;
PROS Motor Commands
Command
What it does
Range
motor.move_voltage(12000)
Spin at full power forward
-12000 to 12000
motor.move_voltage(-12000)
Spin at full power backward
Negative = reverse
motor.move_velocity(200)
Spin at exact RPM speed
-600 to 600 RPM
motor.brake()
Stop the motor (hold position)
—
motor.move(0)
Coast to a stop
—
PROS Controller Buttons
Button name
Physical button
DIGITAL_R1 / DIGITAL_R2
Right bumpers (top / bottom)
DIGITAL_L1 / DIGITAL_L2
Left bumpers (top / bottom)
DIGITAL_A / B / X / Y
Face buttons (right side)
DIGITAL_UP / DOWN / LEFT / RIGHT
D-pad
ANALOG_LEFT_Y
Left joystick, up/down (-127 to 127)
ANALOG_RIGHT_X
Right joystick, left/right (-127 to 127)
EZ Template Drive Commands
Command
What it does
chassis.opcontrol_tank()
Driver control — tank drive mode
chassis.pid_drive_set(24_in, 110)
Autonomous: drive forward 24 inches
chassis.pid_turn_set(90_deg, 90)
Autonomous: turn right 90 degrees
chassis.pid_wait()
Wait until movement finishes before next step
Common Error Messages & Fixes
Error you see
What it usually means
expected ';'
You forgot a semicolon at the end of a line
expected '}'
You opened a { but didn't close it with }
undeclared identifier
You typed a variable/function name that doesn't exist yet
too many arguments
You passed too many values inside the ( )
🚀
You're ready to start! Open VS Code, load up the EZ Template example project, and try changing a motor port number or adding a comment. Every expert started exactly where you are right now.
💬
Stuck? Ask your teacher, post on the VEX Forum (vexforum.com), or join the PROS Discord (discord.gg/pros). The community is super welcoming to beginners.
When you write C++ and click Build, a compiler translates your human-readable code into machine code (binary instructions the CPU executes). This is a multi-stage process: preprocessing → lexical analysis → parsing → code generation → linking. Blocks programming is actually compiled too — it just hides the code. Text coding removes that abstraction, giving you direct control over logic. This is the same jump as going from Scratch to Python — you gain power by taking on responsibility.
🎤 Interview line: “C++ is a compiled language — our source code is translated into machine instructions before it runs on the V5 Brain. Blocks also compiles under the hood; text coding just makes the intermediate step visible and controllable.”
🔬 Check for Understanding
What does the compiler do when you run “Build” in PROS?
It uploads your code directly to the V5 Brain as-is
It checks for syntax errors only
It translates your C++ source code into machine instructions the V5 Brain processor can execute
It converts your code to blocks format for the Brain