'''Due to the Arduino Uno only have 32kb of space, ROBOTC is not able to support String variables or Debug Stream (which requires Strings) on the Arduino Uno platform. Hopefully we can make this enhancement in a future version'''

+

+

----

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 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.

Revision as of 14:48, 14 May 2012

Due to the Arduino Uno only have 32kb of space, ROBOTC is not able to support String variables or Debug Stream (which requires Strings) on the Arduino Uno platform. Hopefully we can make this enhancement in a future version

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.

Contents

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.

writeDebugStreamLine

void writeDebugStreamLine(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.

The only difference between this function and "writeDebugStream" is that a new line character is added after every call of "writeDebugStreamLine".

getAvailSpaceInDebugStream

(short) Variable will return the current amount of space available in the debug stream. For the Arduino platform, the maximum size of the debug stream is 300 bytes.

while(true){if(getAvailSpaceInDebugStream() == 0)//Check if there is still room availablewait1Msec(50); //No Room: Wait for a while.elsewriteDebugStream("Still Have Room!", fooBarVar); //Got room, let's write some data!}

bFloatConversionErrors

intrinsic bool bFloatConversionErrors

(bool) When true, this variable will generate an exception if an out of range error occurs when converting a "float" value to an integer. ROBOTC will convert out of range exceptions into the largest possible integer number.