Start at the top with what you observe. Follow the answers down. Each leaf node is a concrete action you can take.
flowchart TD
Start([Something is wrong
with the robot]) --> Q1{Did the code
compile?}
Q1 -->|"No, compiler error"| Compile[Read the compiler error message.
Common: missing semicolon,
undeclared variable,
wrong namespace
e.g. pros::IMU vs pros::Imu]
Q1 -->|"Yes"| Q2{Does the robot
respond at all?}
Q2 -->|"No"| Power[Battery charged?
Brain on?
Cable seated?
Correct program selected?]
Q2 -->|"Yes, but wrong behavior"| Q3{Driver control or
autonomous?}
Q3 -->|"Driver"| Driver[Add pros::lcd::print
inside opcontrol loop.
Verify each button registers.]
Q3 -->|"Auton"| Auton[Add pros::lcd::print
at each step.
Watch screen during run.
Which step stalls?]
Compile --> Fix([Apply fix, rebuild, retest])
Power --> Fix
Driver --> Fix
Auton --> Fix
style Start fill:#1e293b,stroke:#22d3ee,stroke-width:2px,color:#e2e8f0
style Fix fill:#1e293b,stroke:#22c55e,stroke-width:2px,color:#e2e8f0
style Q1 fill:#fbbf24,color:#0f172a,stroke:#fbbf24
style Q2 fill:#fbbf24,color:#0f172a,stroke:#fbbf24
style Q3 fill:#fbbf24,color:#0f172a,stroke:#fbbf24
Five methods in order from easiest to most powerful. Open this when something is broken and you don't know why.
Print any value to the Brain's 240Γ272px LCD while the robot runs. Perfect for checking sensor reads, variable values, and task state between matches.
// Clear screen + print multiple values pros::lcd::initialize(); // in initialize() // Anywhere in your code: pros::lcd::set_text(1, "IMU: " + std::to_string(chassis.imu.get_heading())); pros::lcd::set_text(2, "Motor temp: " + std::to_string(left_motors[0].get_temperature())); pros::lcd::set_text(3, "Intake on: " + std::to_string(intakeOn));
PROS routes printf() over USB to your VS Code terminal. Run pros terminal in the integrated terminal while the robot is connected.
// Print formatted output to terminal printf("[auton] segment 2 start β heading: %.2f\n", chassis.imu.get_heading()); printf("[intake] speed=%d temp=%.1f\n", intake.get_actual_velocity(), intake.get_temperature()); // Structured log: timestamp + label + value printf("[%dms] motor_temp %.1f\n", pros::millis(), left_motors[0].get_temperature());
\n at the end of every printf β it flushes the buffer.[subsystem] so you can grep the output.#define DEBUG flag before competing.// Debug wrapper β removes all prints in release build #define DEBUG 1 #ifdef DEBUG #define LOG(fmt, ...) printf(fmt, ##__VA_ARGS__) #else #define LOG(fmt, ...) #endif // Use LOG() instead of printf() everywhere LOG("[auton] turn complete β actual: %.2f\n", chassis.imu.get_heading());
When you can't read the Brain screen (robot is far away, or screen is obstructed), use the V5 Brain's built-in status LED or an indicator LED on a 3-wire port to show state.
// Flash an LED N times to indicate state pros::adi::DigitalOut led('A'); void ledFlash(int n) { for (int i = 0; i < n; i++) { led.set_value(1); pros::delay(150); led.set_value(0); pros::delay(150); } pros::delay(400); // gap between sequences } // Flash 1 = step 1 reached, flash 2 = step 2, etc. ledFlash(1); chassis.pid_drive_set(24, 110); chassis.pid_wait(); ledFlash(2); chassis.pid_turn_set(90, 90); chassis.pid_wait();
Write data to a CSV on the Brain's microSD card. Insert a microSD into the Brain, then read the file on your laptop after the run.
#include <fstream> void startLog() { std::ofstream log("/usd/run_log.csv", std::ios::app); log << "time,heading,left_vel,right_vel,temp\n"; log.close(); } void logRow() { std::ofstream log("/usd/run_log.csv", std::ios::app); log << pros::millis() << "," << chassis.imu.get_heading() << "," << chassis.left_motors[0].get_actual_velocity() << "," << chassis.right_motors[0].get_actual_velocity() << "," << chassis.left_motors[0].get_temperature() << "\n"; log.close(); } // Call logRow() every 50ms in a task for a full run record
run_log.csv in Excel or Google Sheets β graph motor velocities to spot stalls.PROS ships a terminal dashboard that shows motor ports, temperatures, currents, and sensor values updated live. Run it while connected via USB.
# In VS Code integrated terminal pros terminal # Separate window for motor dashboard pros monitor
| Situation | Method |
|---|---|
| No laptop, need to see sensor values now | 1 β Brain screen |
| Auton fails at a specific step β want to know which | 2 β Terminal printf with labels |
| Robot is moving and you can't read the screen | 3 β LED flash patterns |
| Intermittent failure, hard to reproduce, want to analyze after | 4 β SD card log |
| Motor overheating or brownout β not sure which port | 5 β pros monitor |