Programming instructions
ROBOTC
Reference
The ROBOTC Debugger
©
Carnegie Mellon Robotics Academy / For use with VEX
®
Robotics Systems
The ROBOTC Debugger Overview
ROBOTC has a debugging capability that enables unparalleled, interactive access to the robot
as your program is running. Using the debugger will signicantly reduce the time it takes to write
programs and nd erros in your code. With ROBOTC’s real-time debugger you can:
• Start and stop your program from the computer
• “Single step” through your program, running one line of code at a time and examine the
results (the values of variables, sensors, ect.) and the ow of execution
• Read and write the values of all the variables dened in your program
• Read the write the values of all the motors and sensors congured on your microcontroller
A “debugger” is a programming tool that enables you to quickly write and correct code, and
allows you to interact with all of the inputs (sensors, timers, ect.) and ouputs (motors, LED’s,
ect.) connected to your VEX microcontroller.
Note: Traditional Debugging Techniques
Debugging a program (nding the errors and correcting them) can be a slow process without a
real-time debugger. Without a debugger you may have to resort to other techniques:
• Adding code to turn on different LED’s as the microcontroller executes different sections of
code. You then try to determine from the LED’s what is being executed within your program.
• Adding “print” statements to your code at various points in the program, if your
microcontroller has a display device. By examining the display, you can (hopefully) determine
what is happening in your program.
Both of the above techniques are available in ROBOTC, but a real-time debugger eliminates the
need to resort to them. There’s no need to add code to debug your program!