Difference between revisions of "ARDUINO MEGA Functions Debug"

From ROBOTC API Guide
Jump to: navigation, search
Line 7: Line 7:
 
You can open this debugger window from the "Robot -> Debugger Windows -> Debug Stream" window when in Expert or Super User mode.
 
You can open this debugger window from the "Robot -> Debugger Windows -> Debug Stream" window when in Expert or Super User mode.
  
(Add picture of Debug Stream)
+
[[File:DebugStream.png]]
 
{{tl|1|1}}
 
{{tl|1|1}}
 
<br />
 
<br />

Revision as of 00:45, 10 May 2012

ARDUINOFunctions and Variables → ARDUINO MEGA Functions Debug


The debugger in ROBOTC allows you to see all of your sensor, motor and variables while running your program. ROBOTC also has a debug terminal called the "Debug Stream" that you can use to output a terminal-like stream of information to have an additional way to monitor your program.

The debug stream is buffered directly in memory on the Arduino platform - You can store 300 bytes of debug stream data on the Arduino when running away from the PC. Once the Arduino is connected to the PC, you can open the debug stream and the entire buffer will be written to the "Debug Stream" debugger window.

You can open this debugger window from the "Robot -> Debugger Windows -> Debug Stream" window when in Expert or Super User mode.

DebugStream.png

Color Key
Function:
Variable:


writeDebugStream

void writeDebugStream(const string sFormatString, ...)
(void) The Debug Stream functionality allow the user to output formatted text to a debug terminal. This command works similar to a print to LCD command, but displays the information to the "Debug Stream" ROBOTC debugger window.
Parameter Explanation Data Type
sFormatString A formatted string following standard C-Style convention for showing data inline. void
  int fooBarVar = 503;                       //Create a Variable to Display
  writeDebugStream("Value: %d", fooBarVar);  //Write the string "Value: 503" to the Debug Stream


writeDebugStream

void writeDebugStream(const string sFormatString, ...)
(void) The Debug Stream functionality allow the user to output formatted text to a debug terminal. This command works similar to a print to LCD command, but displays the information to the "Debug Stream" ROBOTC debugger window.
Parameter Explanation Data Type
sFormatString A formatted string following standard C-Style convention for showing data inline. void
  int fooBarVar = 503;                       //Create a Variable to Display
  writeDebugStream("Value: %d", fooBarVar);  //Write the string "Value: 503" to the Debug Stream


nVexMasterVersion

const word nVexMasterVersion
(word) Variable contains the firmware version for the VEX master CPU.
int MasterFirmwareVer = nVexMasterVersion; // stores the value of the Master Firmware to a variable


version

const word version
(word) Contains the firmware version number.
displayNextLCDNumber(version);  // display the current firmware version on the LCD