ARDUINO MEGA Functions Debug
| Line 2: | Line 2: | ||
<br /> | <br /> | ||
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. | ||
| + | |||
| + | 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. | You can open this debugger window from the "Robot -> Debugger Windows -> Debug Stream" window when in Expert or Super User mode. | ||
| Line 41: | Line 43: | ||
<br /> | <br /> | ||
| − | == | + | == writeDebugStream == |
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0" | {| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0" | ||
|- | |- | ||
| − | | class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB"> | + | | class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">writeDebugStream</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const string </span><span class="bigCodeBasic">sFormatString</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">...</span><span class="bigCodePunc">)</span> |
|- | |- | ||
| − | | style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) | + | | style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|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. |
|- | |- | ||
| | | | ||
| Line 54: | Line 56: | ||
! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type | ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type | ||
|- | |- | ||
| − | | style="border-style: solid; border-width: 1px 0px 1px 0px"|'' | + | | style="border-style: solid; border-width: 1px 0px 1px 0px"|''sFormatString'' |
| − | | style="border-style: solid; border-width: 1px 0px 1px 0px"| | + | | style="border-style: solid; border-width: 1px 0px 1px 0px"|A formatted string following standard C-Style convention for showing data inline. |
| style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_void|void]] | | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_void|void]] | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|- | |- | ||
|} | |} | ||
| Line 72: | Line 66: | ||
|- | |- | ||
|<syntaxhighlight lang="robotc"> | |<syntaxhighlight lang="robotc"> | ||
| − | int | + | int fooBarVar = 503; //Create a Variable to Display |
| − | + | writeDebugStream("Value: %d", fooBarVar); //Write the string "Value: 503" to the Debug Stream | |
| − | + | ||
| − | + | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|- | |- | ||
Revision as of 17:43, 9 May 2012
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.
(Add picture of 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. | ||||||
| ||||||
|
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. | ||||||
| ||||||
|
nVexMasterVersion
| const word nVexMasterVersion | |
| (word) Variable contains the firmware version for the VEX master CPU. | |
|
version
| const word version | |
| (word) Contains the firmware version number. | |
|