How to add command help to custom functions in vex v5 pro

So i was wondering if i could add help to my commands in the text editor, so just in case my team programs because im sick or something i have help on how to use the commands. Can i do that?

It probably depends what environment you’re using. If you use the Vex VSCode extension, you can use Doxygen-style header blocks (I usually put them in my C/CPP file rather than the H file, but either should work).

Here’s an example from my PID code:

/*! ****************************************************************************************************
 @brief Function for driving a given robot in a straight line forward or reverse. NOTE: Single motor 
        on each side only. Separate function for drivetrains with motor groups.
 @param lMotor Pointer to the (single) left motor to use (does not work for motor groups)
 @param rMotor Pointer to the (single) right motor to use (does not work for motor groups)
 @param inertial Pointer to the inertial/gyro to be used for rotation measurement; assumes x-axis
 @param distanceTgtDeg Target distance in degrees
 @param hdgToHoldDeg Heading for robot to hold as part of driving
 @param maxVelocity Velocity in percent to not exceed; this should really be 90% at most. 
        Going to 100% will reduce the impact of heading correction, as it will not be able 
        to speed up one side as it slows the other side down.
 @param closeEnough Value in degrees of when it's "close enough" for the loop to finish; typically
        adjusted for robot momentum in addition to tuning P, I, and D values
 @param driveDir Enumerated direction to drive, forward or reverse
 ******************************************************************************************************/
4 Likes

are you competing now @EngineerMike ?

4 Likes

Hah, that’s from my private GitHub where no students get to see. :slight_smile:

I don’t get nearly as many coding opportunities as I used to (SW leadership and all that), so I use this as a good way to keep my skills sharp and have a good understanding of the workings of the system. Helps to answer the questions better when students have problems.

1 Like

I use Vexcode Pro v5

I have everything organized in namespaces with functions inside the namespace
So i was wondering how i would add it to the autonfunctions.h and the src->buttoncontrols files

Code:
TheUnknownsVer_3.0.zip (5.6 MB)

Just doing a quick test in V5 Pro with your code, doesn’t look like it supports it, unless I’m missing something.

No syntax highlighting on it like VSCode. Nothing stopping you from still doing that sort of documentation (hint: you should, so others can follow your code, and you can remember things two months after you wrote it…).

You could probably also pretty easily move the code into VSCode and then you’d have that access to the tooltip documentation. For instance, what my header block turns out in VSCode:

No, the syntax highlighting is built into the editor and it doesn’t understand Doxygen formatting.

clangd is used for error checking, I don’t think that supports Doxygen either (at least not in the 2019 version VEXcode Pro uses).

Is this from the Microsoft C++ extension ? or something else ?

2 Likes

Probably, other than Vex and LaTeX Workshop, C++ is the only other extension I have installed.

I’m honestly loving VSCode at this point, super glad y’all are integrating into it. :smiley:

2 Likes

I stand corrected. It could be in one of the other C++ extensions as well.

So is it impossible to add to the command help in vex code v5 pro?

yes impossible, you cannot add anything to the help system in VEXcode V5 Pro, best you can do is accurately comment your code.

4 Likes