Half of all "my code is broken" problems are actually hardware problems. This guide teaches you to verify the robot before opening VS Code — saving hours of debugging code that was never the issue.
Before writing a single line of code, power on the V5 Brain and navigate to the Device Info screen. This screen shows every motor and sensor the Brain can detect — and their status. If a device is missing from this screen, it is a hardware problem. Fix it before touching VS Code.
Click each item to expand the inspection detail. Work through these in order — structure first, then power, then sensors.
Grip each drive motor and try to wiggle it. It should not move relative to the chassis. Check the two mounting screws on each motor — they work loose over time from vibration.
Each smart cable has a small locking tab. Press it in and pull to confirm it is actually latched — do not just tug. Follow every cable from the motor to the Brain port.
Manually move every mechanism through its full range of motion — arm up and down, claw open and closed, drive wheels forward and back. Watch cables as mechanisms move.
Press the battery firmly into its mount and confirm the latch is engaged. The Brain should show a solid battery icon — not a flashing one.
Place the robot on a flat surface. Look at the IMU from the side — its top face should be level with the floor, not angled. Even a 5-degree tilt causes heading errors.
chassis.initialize() to recalibrateLift each side of the robot and spin the drive wheels by hand. They should spin freely with minimal resistance. If a wheel is stiff or catches, find the mechanical source before coding.
From the Brain home screen: tap the V5 logo → Settings → Device Info. Every detected smart device appears with its port number and device type.
For each device shown, enter the port number, device name, and what mechanism it controls. The "Code Port" column is what you will use in your ez::Drive chassis declaration — include the negative sign if the motor needs to be reversed.
If a device you expect to see is not on the screen, do not move on. That is a hardware problem to fix before writing code. Check the cable seating at both ends.
This table saves automatically. Use it as your reference when configuring ez::Drive and declaring motors in globals.hpp.
| Brain Port | Device Type | Mechanism / Label | Code Port | Direction |
|---|
Once your port log is complete, your ez::Drive declaration in main.cpp uses those exact numbers. Negative means reversed:
ez::Drive chassis({1, 2, 3}, {4, 5, 6}, 7, 3.25, 200) but motor 3 is actually plugged into port 8 on the Brain. What happens?From the Brain home screen: tap the V5 logo → Devices → select any Motor. You will see a control panel with a voltage slider. This lets you spin that specific motor directly from the Brain.
Set voltage to about 30 (roughly 25% speed). Spin each drive motor one at a time. Watch which direction the wheel turns. You are looking for: left motors all spinning in the same direction, right motors all spinning in the same direction, and left/right sides mirrored so the robot drives straight when both sides run positive.
If a left-side motor spins the wrong way relative to its neighbors, it needs a negative port number in your chassis config. Record these findings in your port log before writing any code.
ez::Drive chassis config. Do not re-wire the physical motor.
3 to -3). Do not flip the physical cable or re-wire the motor — that creates confusion for anyone who works on the robot later.After uploading code for the first time, follow this sequence before putting the robot on the floor:
Hold it securely or place it on blocks. All four wheels should be off the ground with clearance to spin freely.
All drive wheels should spin forward. If any wheel spins backward, that motor's port needs to be negated. If the robot spins in place, the left and right sides are reversed — swap the port arrays in your chassis config.
Turn left and right. Left turn: right wheels forward, left wheels backward. Right turn: left wheels forward, right wheels backward. Confirm this is what you see.
Once all directions are verified in the air, carefully place the robot down and test driving slowly. The first floor test should be at reduced speed — set chassis.set_max_speed(60) in initialize until you are confident everything is correct.