ARDUINO MEGA Functions Debug

Revision as of 00:29, 10 May 2012 by Tfriez (Talk | contribs)

Jump to: navigation, search
ARDUINOFunctions and Variables → ARDUINO MEGA Functions Debug

Color Key


void writeDebugStream(const stringsFormatString)
(void) The Debug Stream functionality allow the user to output formatted text to a debug terminal, similar to a printf statement in a command line terminal window.
Parameter Explanation Data Type
sFormatString A formatted String void
string sTemp = "ROBOTC";               // create a string, 'sTemp' to be "ROBOTC"
char sArray[20];                       // create a char array, 'sArray' of size 20
memcpy(sArray, sTemp, sizeof(sTemp));  // copy characters from 'sTemp' to 'sArray'


void memset(void &pToBuffer, const short nValue, const short nNumbOfBytes)
(void) Sets a block of memory at pToBuffer to the value nValue. nNumbOfBytes is the number of bytes to set. This is a useful function for initializing the value of an array to all zeros. Identical to the function found in conventional C 'string.h' library.
Parameter Explanation Data Type
pToBuffer buffer to set void
nValue value to set buffer to short
nNumbOfBytes number of bytes to set short
int kSendSize = 1;                                   // we will be sending 1 byte
ubyte BytesToSend[kSendSize];                        // create a ubyte array of size 1
short nMsgXmit = 0;                                  // we will be setting them to 0
memset(BytesToSend, nMsgXmit, sizeof(BytesToSend));  // set the Byte Array to 0


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


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